Website Development Online Courses
Currently Browsing: JavaScript

Assignment Operators in JavaScript

Assignment operators are used to assign values to JavaScript variables Given that x = 10 and y = 5, the table below explains the assignment operators: Please go through all the...

Comparison Operators in JavaScript

Comparison operators are used in logical statements to determine equality or difference between variables or values. Given that x = 7, the table below explains the comparison operators: Please go through each and every operator and try to remember...

Arithmetic Operators in JavaScript

The standard Arithmetic operators are as follows: OperatorsDescription Addition+ Subtraction- Multiplication* Division/ Modulus% Increment++ Decrement-- Let see Example of each Addition <script type="text/javascript> var x = 5; var y = 3; var result = x + y; document.write("Final Result is " + result); </script> The answer will be 8 which is 5 + 3 Subtracion <script...

Different ways to concatenate a string in javascript

Hi Friends, Concatenate a string in three different ways in JavaScript. Below are the methods The addition operator (+). The assignment operator (+=). The built-in concat method. Each example is given below Using addition operator <script type="text/javascript"> var str1 = "Hello"; var str2 = "world"; var result = str1 + " " + str2; document.write(result);...

Data Types in JavaScript

Hi Friends, JavaScript has 6 Primitive and 1 Non Primitive data type. Primitive Data Type: 1) Boolean <script type="text/javascript"> var x = true; if (x) { console.log("Booleans works"); } else { console.log("Booleans are flimsy"); } </script> 12345678 <script type="text/javascript">  var x = true;  if (x) {  console.log("Booleans works");  } else...

« Previous Entries

nstinftotech.com Copyright © 2017