javascriptCheck if a string is blank
var is_blank = str.trim().length === 0;ctrl + c| is_blankwill contain  | str.trim()trims whitespaces around the string | 
| .length === 0returns  | |
More of Javascript
- Round to 1 decimal
- How to return to a previous page
- Get all children and grandchildren of an html element recursively
- Get selected option text of a dropdown (select) box
- Get hostname by url
- Check if string contains substring
- Shuffle (randomize) an array
- Insert text into textarea at cursor position
- How to check if array contains certain value
- Pretty print JSON
See more codes...