This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Question 1 | |
indexOf returns the integer value | |
and when you attach ! with it it returns true | |
so instead of checking for true or false we can | |
check the integers | |
function myFunction() { | |
var str="Superman OS running"; | |
if (str.toLowerCase().indexOf('superman') == -1) { | |
console.log('String does not contain superman'); |