Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

javascript Implicit Conversion to String

// numeric string used with + gives string type
let result;

result = '3' + 2; 
console.log(result) // "32"

result = '3' + true; 
console.log(result); // "3true"

result = '3' + undefined; 
console.log(result); // "3undefined"

result = '3' + null; 
console.log(result); // "3null"
Comment

javascript Implicit Conversion to String

// numeric string used with + gives string type
let result;

result = '3' + 2; 
console.log(result) // "32"

result = '3' + true; 
console.log(result); // "3true"

result = '3' + undefined; 
console.log(result); // "3undefined"

result = '3' + null; 
console.log(result); // "3null"
Comment

PREVIOUS NEXT
Code Example
Javascript :: javascript undefined used with number, boolean or null 
Javascript :: JavaScript for loop Display Numbers from 1 to 5 
Javascript :: eleventy filter newlines 
Javascript :: clear input field react 
Javascript :: javascript prototype chaining 
Javascript :: javascript Add Symbol as an Object Key 
Javascript :: javascript Arrow Function with Promises and Callbacks 
Javascript :: javascript Set Subset Operation 
Javascript :: intervals 
Javascript :: JavaScript Generator Function With return 
Javascript :: JavaScript HTML DOM Navigation 
Javascript :: find the missing number javascript 
Javascript :: JavaScript / jQuery HTML Elements 
Javascript :: circular object array 
Javascript :: divide array in chunks 
Javascript :: set angle in phaser 
Javascript :: phaser place items on circle reverse 
Javascript :: phaser export animation to json 
Javascript :: lookbehind alternative regex 
Javascript :: template literal inside a key in react 
Javascript :: using lambda for elasticache node.js 
Javascript :: spiral traversal clockwise direction js 
Javascript :: Self Invoking Functions Can Also be Used To Make Variables Global In JavaScript 
Javascript :: javascript check item is checkbox 
Javascript :: brightness javascript 
Javascript :: kafkajs 
Javascript :: js unshift vs push 
Javascript :: convert a string to array 
Javascript :: javascript operators 
Javascript :: javascript set header text 
ADD CONTENT
Topic
Content
Source link
Name
7+3 =