A compare function should be provided when using “Array.prototype.sort()”

The default sort order is alphabetic, rather than numeric, regardless of the types in the array. Specifically, even if an array contains only numbers, all values in it will be converted to strings and sorted lexicographically, for an order like this: 1, 15, 2, 20, 5. Even to sort strings, the default sort order may… Continue reading A compare function should be provided when using “Array.prototype.sort()”

Advantages of Next JS as a frontend Framework.

As React became the most widely adopted web framework, encompassing over 40% of developers in 2021 according to Statista, Next.js adoption has also grown dramatically. Vercel, the company that maintains Next.js, cites over 6 million downloads since its launch and 50% usage growth in the top ten-thousand websites for the period of October 2020 to… Continue reading Advantages of Next JS as a frontend Framework.

How to add GA4(Google Analytics4) Script on the website for different events and tags.

For adding the script on the head of the website you need to first implement the GA4 on the NetSuite and need to configure the GTM id on the configuration record of the respective website. Then we need to create a tag on the GTM for the custom events for the recommended events by Google… Continue reading How to add GA4(Google Analytics4) Script on the website for different events and tags.

TypeError : can’t delete non-configurable array element

The JavaScript exception “can’t delete non-configurable array element” occurs when it was attempted to shorten the length of an array, but one of the array’s elements is non-configurable. Message : Error type :  TypeError What went wrong?It was attempted to shorten the length of an array, but one of the array’s elements is non-configurable. When… Continue reading TypeError : can’t delete non-configurable array element

SuiteScript 2.0 Client Script Debugging

Scenario: I recently ran into a problem where I created a Suitelet that downloaded HTML to include in the page. Next, I wanted to add JavaScript. However, when I went to debug the JavaScript in Chrome it threw an error, but the “Sources” tab in Chrome Dev Tools was blank. I saw the red X,… Continue reading SuiteScript 2.0 Client Script Debugging

The ‘Add Multiple’ button action, which is responsible for adding multiple items in the item sublist, will not trigger in the client script. Similarly, the client script entry points do not trigger the population of the group items component.

In NetSuite, the ‘Add Multiple’ button action, which allows users to add multiple items to the item sublist at once, does not trigger the client script’s events or entry points. This means that if you have a client script attached to the record, the functions defined in the client script (such as validateLine, fieldChanged, lineInit,… Continue reading The ‘Add Multiple’ button action, which is responsible for adding multiple items in the item sublist, will not trigger in the client script. Similarly, the client script entry points do not trigger the population of the group items component.

Array Merge/ Combine in JS

Merge without removing duplicate elements -> Using concat() Method: The concat() method accepts arrays as arguments and returns the merged array. // with elements of nums1 and returns the // combined array – combinedSum arraylet combinedNums = nums1.concat(nums2, nums3);// More readable formlet combinedNums = [].concat(nums1, nums2, nums3); -> Using spread operator: Spread operator spreads the value of the array into… Continue reading Array Merge/ Combine in JS

Map in JavaScript

In JavaScript, a Map is a built-in object that allows you to store key-value pairs, similar to an object. However, a Map offers some additional functionality that makes it useful in certain situations. Here’s an example of creating a Map: To add a key-value pair to the Map, you can use the set() method: You… Continue reading Map in JavaScript

Set in JavaScript

In JavaScript, a Set is a collection of unique values of any type, which means that each value can occur only once in the Set. It can be used to store a collection of values without any duplication. To create a Set in JavaScript, we use the Set() constructor or the Set literal notation by… Continue reading Set in JavaScript