Answers for "is empty string falsey"

1

is empty string falsey

There are only six falsey values in JavaScript: 
- undefined
- null 
- NaN
- 0
- "" (empty string),
- false
Posted by: Guest on February-16-2022
0

is empty string falsy

// This is dependent on the language you are using.
// In most high-level-languages (like JavaScript or Python) they are falsy.
if (""){
	console.log("This will never execute")
}

// However many low-level-languages (like C or C++) they are truthy, because
// they are just a pointer to some container, and a pointer that doesn't
// point to null is truthy.
Posted by: Guest on December-18-2021

Browse Popular Code Answers by Language