In javascript, is an empty string always false as a boolean?

in javascript,

var a = '';
var b = (a) ? false : true;   // fixed!

var b will be set to false.

is this a defined behavior that can be relied upon?



Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.