Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

concatenate 2 numbers js

Use "" + 5 + 6 to force it to strings. 
This works with numerical variables too:

var a = 5;
var b = 6;
console.log("" + a + b);
Comment

Simple code example of adding two numbers in javascript

<script>
function addNumbers(a, b) {  
    return a + b;  
}  
var sum = addNumbers(15, 25);  
document.write('Sum of the numbers is: ' + sum); 
</script>
Comment

add two numbers in javascript

const addTwoNumbers = (a,b)=>{
return a+b
}

console.log(addTwoNumbers(6,5))
Comment

javascript Function Add Two Numbers

// program to add two numbers using a function
// declaring a function
function add(a, b) {
    console.log(a + b);
}

// calling functions
add(3,4);
add(2,9);
Comment

javascript function add two numbers

//Simple Function to add two numbers
const addTwoNums = (num1, num2) => {
    let sum = num1 + num2;
    return sum
}
console.log(addTwoNums(60, 9)) //function call and log the answer to the console
Comment

PREVIOUS NEXT
Code Example
Javascript :: time complexity javascript 
Javascript :: what is npm audit 
Javascript :: next js build command 
Javascript :: click select option to update div jquery 
Javascript :: two decimal places javascript 
Javascript :: async useeffect 
Javascript :: javascript on uncaught exception 
Javascript :: get minutes and seconds from youtube seconds on js 
Javascript :: javascript get query params from url 
Javascript :: how to get type of variable in javascript 
Javascript :: disemvowel javascript 
Javascript :: exist element js 
Javascript :: how to counts date from moment js 
Javascript :: how to validate email in node js 
Javascript :: call ajax after ajax 
Javascript :: react detect autofill 
Javascript :: auto import vscode not working 
Javascript :: open link in new tab javascript 
Javascript :: jquery from object to queryselector 
Javascript :: react hook form validation 
Javascript :: javascript math random floor 
Javascript :: filter object js 
Javascript :: how to check string uppercase or lowersace using regex javascript 
Javascript :: js copy image to clipboard 
Javascript :: mongoose response to object 
Javascript :: how to remove sub array null index in javascript 
Javascript :: append after div 
Javascript :: javascript form validation 
Javascript :: Find the next perfect square! 
Javascript :: javascript exponential 
ADD CONTENT
Topic
Content
Source link
Name
4+2 =