Answers for "js +="

C++
4

javascript function to add two numbers

<!--Add two integer numbers using JavaScript.-->
<html>
	<head>
		<title>Add two integer numbers using JavaScript.</title>
		<script type="text/javascript">
			function addTwoNumbers(textBox1, textBox2){
				var x=document.getElementById(textBox1).value;
				var y=document.getElementById(textBox2).value;
				var sum=0;
				sum=Number(x)+Number(y);
				alert("SUM is: " + sum);
			}
		</script>
	</head>
<body>
	<h1>Add two integer numbers using JavaScript.</h1>
	<b>Enter first Number: </b><br>
	<input type="text" id="textIn1"/><br>
	<b>Enter second Number: </b><br>
	<input type="text" id="textIn2"/><br><br>
	<input type="button" id="btnSum" value="Calculate SUM" onClick="addTwoNumbers('textIn1','textIn2')"/>
</body>

</html>
Posted by: Guest on April-11-2020
1

+=

addition assignment operator
Posted by: Guest on November-03-2020
1

|| in js

const a = 3;
const b = -2;

console.log(a > 0 || b > 0);
// expected output: true
Posted by: Guest on October-19-2020
1

javascript +=

Addition assignment (+=) The operator ( += ) 
adds the value of the right operand to a variable
Posted by: Guest on June-24-2021
0

what does -= mean in JavaScript

/* JavaScript shorthand -=
-= is shorthand to subtract something from a
variable and store the result as that same variable.
*/

// The standard syntax:
var myVar = 5; 
console.log(myVar) // 5
var myVar = myVar - 3;
console.log(myVar) // 2

// The shorthand:
var myVar = 5;
console.log(myVar) // 5
var myVar -= 3;
console.log(myVar) // 2
Posted by: Guest on February-18-2020

Browse Popular Code Answers by Language