This post aims to only list out the most common use of JavaScript Type Conversions:
Convert to Boolean:
var boolValue = !!x;
Convert to String:
var stringValue = ""+x;
Convert to Number:
var numValue = +x;
This post aims to only list out the most common use of JavaScript Type Conversions:
Convert to Boolean:
var boolValue = !!x;
Convert to String:
var stringValue = ""+x;
Convert to Number:
var numValue = +x;