The following code can be used to convert XML to JSON. define([“require”, “exports”, “N/xml”], function (require, exports, xmlModule) { “use strict”; Object.defineProperty(exports, “__esModule”, { value: true }); exports.xml2json = exports.nsXMLToJSON = exports.xmlToJson = void 0; //https://stackoverflow.com/a/57735605 const xmlToJson = (xmlString) => { … Continue reading script for XML to JSON Parser
Category: JavaScript
Mastering JavaScript: Multiple Ways to Generate a Two-Dimensional Array
Can you generate a two-dimensional array using JavaScript? This question might seem simple. Just as there are various methods to achieve the same goal, there are also various methods to generate a two-dimensional array. Today, let’s explore the answers behind this question and uncover the secrets of generating two-dimensional arrays. Knowing different methods not only… Continue reading Mastering JavaScript: Multiple Ways to Generate a Two-Dimensional Array
Implementing JavaScript Concepts from Scratch
In this article, we explore the foundational building blocks of JavaScript by crafting several key components from the ground up. As we delve into these concepts, we will apply a range of techniques, from basic to sophisticated, making this exploration valuable for both newcomers to the JavaScript world and professionals. TOC memoize() Array.map() Array.filter() Array.reduce()… Continue reading Implementing JavaScript Concepts from Scratch
How to Compare Two Dates in JavaScript – Techniques, Methods, and Best Practices
In JavaScript, you can use the date object to work effectively with dates, times, and time zones within an application. Date objects help you efficiently manipulate data, handle various date-related tasks, and perform some calculations when creating real-world applications. In this article, we will learn about the following topics: Overview of Date Comparison Importance of… Continue reading How to Compare Two Dates in JavaScript – Techniques, Methods, and Best Practices
Everything about Data Fetching & the JavaScript Fetch API
The lifeblood of modern web applications is data. They rely on fetching information from various sources to deliver dynamic and interactive experiences. This is where the JavaScript Fetch API comes in – a powerful tool that simplifies how you retrieve data across networks. Making a fetch request. Fetch is a promise based api. To make a fetch request, use… Continue reading Everything about Data Fetching & the JavaScript Fetch API
spread syntax with objects
In JavaScript, the spread syntax (…) can be used in object literals to copy the properties from one object into another object. It provides a concise way to merge multiple objects or clone an object. Here’s an example of using spread syntax with objects: const obj1 = { a: 1, b: 2 }; const obj2… Continue reading spread syntax with objects
What is the JavaScript Internationalization API (I18n)
English is the world’s most widely used language, yet only one in seven people speak it. It’s the first (native) language of 379 million people, but 917 million speak Mandarin Chinese, 460 million speak Spanish, and 341 million speak Hindi. Many non-English speakers reside in emerging markets with exponential internet growth. If your web app… Continue reading What is the JavaScript Internationalization API (I18n)
Using web workers for safe, concurrent JavaScript
Web workers provide a way to run JavaScript code outside the single thread of execution in the browser. The single thread handles requests to display content as well as user interactions via keyboard, mouse clicks, and other devices, and also responses to AJAX requests. Event handling and AJAX requests are asynchronous and can be considered… Continue reading Using web workers for safe, concurrent JavaScript
Securing Node.js in Production: Expert Practices for Every Developer
As web development keeps evolving, ensuring the security of your Node.js application becomes critical. This detailed guide steps beyond elementary suggestions, offering a closer look at advanced security techniques for Node.js setups. 1. Operating Without Root Privileges: A Must-Do Running Node.js or any web server as a root user poses a significant security risk. A… Continue reading Securing Node.js in Production: Expert Practices for Every Developer
Polymorphism in Javascript
Summary: Polymorphism is a fundamental concept in object-oriented programming (OOP) languages, where “poly” refers to many and “morph” signifies transforming one form into another. In the context of programming, polymorphism enables the same function to be called with different signatures, allowing for flexibility and adaptability in code design. Understanding Polymorphism: In real-life scenarios, individuals often… Continue reading Polymorphism in Javascript