check whether a string contains a substring in JavaScript

JavaScript

🤖 Code Explanation

The code defines a function that takes in two strings as arguments. The function checks if the second string is a substring of the first string and returns true or false. In the example, the function returns true because 'World' is a substring of 'Hello World'.

Download SpellBox today