If you want to learn about the basics of promises, you can refer here.
let a = 5; let b = 2; let sum = a + b; // 7 let difference = a - b; // 3 let product = a * b; // 10 let quotient = a / b; // 2.5 let remainder = a % b; // 1
let a = 5; let b = 3; console.log(a > b); // true console.log(a == b); // false
let x = 5; let y = 3; console.log(x > 0 && y < 10); // true console.log(x > 0 || y > 10); // true console.log(!(x === y)); // true
Assignment operators are used to assign values to variables. They combine the assignment operator (=) with other operators to perform an operation and assign the result to a variable. Here’s an example:
let x = 5; x += 3; // Equivalent to x = x + 3 console.log(x); // 8
Expressions are combinations of values, variables, operators, and function calls that evaluate a single value. They can be as simple as a single variable or as complex as a series of nested operations. Expressions are used in assignments, function calls, conditional statements, and more. Let’s see an example:
let a = 5; let b = 3; let result = (a + b) * 2; console.log(result); // 16
The above example,
(a + b) * 2 is an expression that evaluates to
16. The expression performs addition, multiplication, and grouping operations to compute the final result.
Finally, for more such posts, please follow our LinkedIn page- FrontEnd Competency.