Quiz on JavaScript Empty String Check



1. Which method can be used to check if a string is empty in JavaScript?
2. What will be the result of checking 'console.log(''.length)?
3. Which of the following expressions evaluates to true for an empty string?
4. What does the trim() method do when applied to a string?
5. How can you explicitly check if a string is empty in JavaScript?

Advertisements