Construction of an array followed by checking whether any particular value which is required by the user is included (or present) in the array or not. But let us first see how we could create an array in JavaScript using the following syntax- Syntax: The following syntax would be helpful for any user for the creation… Continue reading How to check whether an array includes a particular value or not in JavaScript?
Tag: javascript
How to change results per Page in SCA.
By default in SCA configuration records, it is set to 20. But sometimes we need to reduce the search results instead of a long number of lists we need to separate this by a number of pages. That’s why we have to reduce the search results. For that, you have to use a standard SCA… Continue reading How to change results per Page in SCA.
How we can use two SASS files in a extension
While creating a Extension in SuiteCommerce Advanced we get a default Sass file. But while doing development so much style needed and in one file it’s difficult to find the classes and IDs there. In this case we can create new SASS file and and we’ve to just import that SASS file into main entry… Continue reading How we can use two SASS files in a extension
Filter Unique Values
The Set object lets you store unique values of any type, whether primitive values or object references. With the spread operator, we can use it to create a new array with unique values.
Issue in iterating search results
Scenario: While creating saved searches, after getting its result we may need to iterate the result sometimes after the iteration only one item may show in the console(or any output platform). Solution: The searchResults.run() method need a return true statement to continue the iteration. In Suite script, there is no break statement to break the… Continue reading Issue in iterating search results
Comparing Two dates
Scenario: We have a start date and a Due date and need to a validation where Due date date should be a date after the Start date. Solution: Usually we can use the JavaScript Date() function. But you can’t compare two dates using that. Better approach to make comparison between dates is to use getTime() function. This… Continue reading Comparing Two dates
Adding popup into login page.
Adding a popup into login page of Ecommerce website for specific customer. It’ll render a Popup into Login page when customer tries to login into his/her account. This loginpopup function will call the event in the login file just after clicking into Login button in the login page. And layout variable will get the layout… Continue reading Adding popup into login page.
Using this keyword in JavaScript.
this keyword in JavaScript is a The value that this stores is the current execution context of the JavaScript program. Thus, when used inside a function this‘s value will change depending on how that function is defined, how it is invoked and the default execution context. this always holds the reference to a single object, that defines the current line of… Continue reading Using this keyword in JavaScript.
Async functions
An async function is a function declared with the async keyword. Async functions are instances of the AsyncFunction constructor, and the await keyword is permitted within them. The async and await keywords enable asynchronous, promise-based behavior to be written in a cleaner style, avoiding the need to explicitly configure promise chains. Async functions may also… Continue reading Async functions
Return Value From Array Using Value of Another Key
The following function can be used to return value from an array by giving another key and value.