Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js string vs number difference

let x = 2;       // number
let y = '2';     // string

console.log(x + x); // 4
console.log(x + y); // 22
Source by learn.coderslang.com #
 
PREVIOUS NEXT
Tagged: #js #string #number #difference
ADD COMMENT
Topic
Name
2+5 =