Search for a string in a string | Javascript functions | ServiceNow
[Music] did you know that there is a javascript function which helps you check whether one string exists within the other string or not and obviously it works both client side and server side because it is more specific to the javascript library then the service now specific libraries so let me quickly show you a demo of how it works in both server side and client side if i click on the history part so here i have already written this script if i click on run now it should say yes which it said and if i make it holiday one then it should say no so the name of the function which i am referring to is includes so this checks whether the first string which is holiday one exists within the second string or not which is today's holiday and it does not exist here so this is working perfectly fine now let me show how it is going to work towards client side so when i talk about client side gs.info does not exist so let me replace it with alert and if i click on her now it should say no yes it works and if i remove this one now and i run it again it says yes so this is working as expected thank you so much for watching bye
https://www.youtube.com/watch?v=HNpt-dNVK3g