JavaScript doesn't have a built-in way to check if a value is blank, but it's easy to create one. The inspiration for this comes from Rails' blank? method, but modified to fit JavaScript's needs. This can be easily checked by using Object.keys() for both types of values.

•1m read time•From 30secondsofcode.org
Post cover image
1 Impression1 Comment