1. Check if a variable is an array:
Ans . Array.isArray(variable);
2 . Convert a string to lowercase:
Ans. var lowercaseString = string.toLowerCase();
3 . Generate a random number between a minimum and maximum value:
Ans . var randomNumber = Math.floor(Math.random() * (max - min + 1)) + min;
4. Get the current date and time:
Ans . var currentDate = new Date();
5. Check if a string contains a specific substring:
Ans . var containsSubstring = string.includes(substring);
No comments:
Post a Comment