Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

can we add string and int in javascript

string + number = concatenated string

number + number = the sum of both numbers

string - number = the difference between (coerced string) and the number

"" + 1 + 10 + 2 = (string) "1102"    
"1102" - 5      = (number)  1097
1097 + "8"      = (string) "10798"
Comment

PREVIOUS NEXT
Code Example
Javascript :: how to print a list in javascript 
Javascript :: discord js channel send 
Javascript :: enzyme airnb 
Javascript :: concatenate arrays javascript 
Javascript :: vscode react snippets 
Javascript :: Find a palindrome using Array methods 
Javascript :: material ui phone number input 
Javascript :: arrow function javascript rules 
Javascript :: convert string to array with condition javascirpt 
Javascript :: What are "res" and "req" parameters in Express functions 
Javascript :: how to remove the last value of javascript array 
Javascript :: react throttle render 
Javascript :: react onclick remove component 
Javascript :: template literals in js 
Javascript :: work with query string javascript 
Javascript :: Sort by month name javascript 
Javascript :: hi;ight word in textarea javascript 
Javascript :: jq append value to array 
Javascript :: err handling express 
Javascript :: use index of an array within a for loop 
Javascript :: js then vs await 
Javascript :: node.js Readable Streams 
Javascript :: regex or operator 
Javascript :: react faq 
Javascript :: javascript unit testing frameworks 
Javascript :: joi.validate 
Javascript :: array of objects in js 
Javascript :: flatten array 
Javascript :: passport js npm 
Javascript :: load a component on button click react 
ADD CONTENT
Topic
Content
Source link
Name
2+3 =