Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

operators in js

//Logical Binary and Ternary Operators in Javascript

== Equal to
=== Strictly equal to
!= Not equal to
!== Strictly not equal to
> Greater than
< Less than
>= Greater than or equal to
<= Less than or equal to

&& Logical and
|| Logical or
! Logical not

? Ternary operator
Comment

JS basic operators

// Math Operators
const now = 2022;
const age1 = now - 1994;
const age2 = now - 2000;

console.log(age1 * 2, age1 / 10, 2 ** 3);
// 2 ** 3 = 2 * 2 * 2

// Assigment Operators
let x = 10 + 5; //15

x += 10; // x = x + 10 = 25
x *= 4; // x = x * 4 = 25 * 4 = 100
x /= 5; // x = x / 5 = 100 / 5 = 20
x++; // x = x + 1
x--; // x = x - 1

// Comparison Operators
const isFullAge = age2 >= 18;
Comment

JavaScript Operators

var x = 5;         // assign the value 5 to x
var y = 2;         // assign the value 2 to y
var z = x + y;     // assign the value 7 to z (5 + 2)
Comment

JavaScript Operators

let x = 5;         // assign the value 5 to x
let y = 2;         // assign the value 2 to y
let z = x + y; 
Comment

PREVIOUS NEXT
Code Example
Javascript :: monngoose find from an array using in 
Javascript :: is javascript an object oriented language 
Javascript :: react native activity 
Javascript :: gitea 
Javascript :: javascript sort object by value descending 
Javascript :: copy folder in nodejs 
Javascript :: react-hook-form-input npm 
Javascript :: Difference Between for...of and for...in Statement 
Javascript :: react native generate signed apk getting older version 
Javascript :: node.js folder structure 
Javascript :: simulate mouse click javascript 
Javascript :: where from terminal colors come 
Javascript :: how to reload webview in react native 
Javascript :: disable a function javascript 
Javascript :: javascript code checker 
Javascript :: javascript callbacks 
Javascript :: graphql json schema 
Javascript :: js upload file size limit 
Javascript :: Extension Google Chrome Create.. 
Javascript :: javascript array methods cheat sheet 
Javascript :: angular conditional tooltip 
Javascript :: even numbers in an array 
Javascript :: validate firstname in javascript 
Javascript :: jquery direct window print pdf 
Javascript :: join string js with and at the last item 
Javascript :: javascript loop array 
Javascript :: convert arrow function to normal function javascript online 
Python :: check if tensorflow gpu is installed 
Python :: check python version colab 
Python :: vowel and consonant list python 
ADD CONTENT
Topic
Content
Source link
Name
4+8 =