“let” keyword: This is basically a super local variable, it’s very useful for using them in for loops. Now you can have multiple nested for loops and declare all of your loop counter variables “i” and not worry about conflicts. Example Using var: var i = 5; for (var i = 0; i < 10; i++) { // after last loop… Continue reading ES6 Features to Adopt in SuiteScript 2.1
Tag: javascript and suitescript
encodeURIComponent
The encodeURIComponent() function encodes a URI by replacing each instance of certain characters with one, two, three, or four escape sequences representing the UTF-8 encoding of the character (will only be four escape sequences for characters composed of two surrogate characters). Compared to encodeURI(), this function encodes more characters, including those that are part of… Continue reading encodeURIComponent
Find the card type using card number
The requirement is to find out the card type of a credit/card in the backend using the card number entered in the card. Use the below code to get the card type of a card.