My Blog

My WordPress Blog

My Blog

My WordPress Blog

2. JavaScript Operators

Operator Precedence

In JavaScript, operator precedence ensures the priority of the operators to be executed when a single expression contains multiple operators. So, whatever expressions have higher priority, the compiler executes it first over other operators and then executes the operators with the lower precedence. Whenever you write any JavaScript expression with only 1 or 2 operators, you can […]

Exponentiation Operator

Exponentiation Operator The exponentiation operator in JavaScript is represented as **. The exponentiation operator takes two operands and returns the power of the first operand raised to the second. The exponentiation operator can also accept the variables of the BigInt data type as operands. Also, it follows the property of associativity, which means a**b**c and a**(b**c) expressions […]

Yield Operator

JavaScript Yield Operator The yield operator in JavaScript is used to pause and resume the generator function asynchronously. In JavaScript, generator functions are the special functions that you can pause or resume while executing. The generator functions are defined with the ‘function*’ syntax. The yield keyword can only be used within the generator function that contains it. The yield operator pauses […]

Grouping Operator

JavaScript Grouping Operator The grouping operator in JavaScript controls the precedence of the evaluation in expressions. It is denoted by parenthesis (), and you can put the expression inside that to change the expression evaluation order. It helps to evaluate an expression with lower precedence before an expression with higher precedence. Syntax You can follow the syntax […]

Safe Assignment Operator

JavaScript Safe Assignment Operator (?=) is a suggested new feature for JavaScript that makes it easier to handle errors in code. This operator helps developers deal with errors more simply, without having to use complicated try/catch blocks. It is denoted by (?=) symbol. It is currently under development and not yet part of the official ECMAScript specification. Syntax The […]

Nullish Coalescing Operator

Nullish Coalescing Operator The Nullish Coalescing operator in JavaScript is represented by two question marks (??). It takes two operands and returns the first operand if it is not null or undefined. Otherwise, it returns the second operand. It is a logical operator introduced in ES2020. In many cases, we can have the null or empty values stored in the […]

Scroll to top