The instances of Date implement the toJSON() function by returning a string (the same as date.toISOString()), thus they are treated as strings. 2. It contains single set of the square bracket (“[]”). Pre-ES6 alternative to includes(): indexOf() Pre-ES6, the common way to check if a string contains a substring was to use indexOf, which is a string method that return -1 if the string does not contain the substring.If the substring is found, it returns the index of the character that starts the string. Interfaces provide useful abstraction on class and can be useful … Checking whether an array contains a value or another array. What has Mordenkainen done to maintain the balance? Example: Using TypeScript ‘Spread’ operator rev 2021.1.20.38359, The best answers are voted up and rise to the top, Code Review Stack Exchange works best with JavaScript enabled, Start here for a quick overview of the site, Detailed answers to any questions you might have, Discuss the workings and policies of this site, Learn more about Stack Overflow the company, Learn more about hiring developers or posting ads with us, I have rolled back your last edit. every() method tests whether all the elements in an array passes the test implemented by the provided function. How to set the default value for an HTML