My Blog

My WordPress Blog

My Blog

My WordPress Blog

Day: July 10, 2025

User Defined Iterators

In JavaScript, an iterable is an object which has Symbol.iterator() method in the object prototype. Some examples of iterable are array, set, map, string, etc. The Symbol.iterator() method returns an object containing the next() method is called iterator. Here, the next() method returns the elements of iterable in each call. The next() Method The next() method […]

Switch Case

The JavaScript switch case is a conditional statement is used to execute different blocks of code depending on the value of an expression. The expression is evaluated, and if it matches the value of one of the case labels, the code block associated with that case is executed. If none of the case labels match the value of the […]

Break Statement

The break statement in JavaScript terminates the loop or switch case statement. When you use the break statement with the loop, the control flow jumps out of the loop and continues to execute the other code. The break statement can also be used to jump a labeled statement when used within that labeled statement. It is a useful tool for controlling […]

For…in Loop

The for…in Loop The for…in loop in JavaScript is used to loop through an object’s properties. The JavaScript for…in loop is a variant of the for loop. The for loop can’t be used to traverse through the object properties. So, the for…in loop is introduced to traverse through all object properties. As we have not discussed Objects yet, you may not feel comfortable […]

For Loop

The JavaScript for loop is used to execute a block of code repeteatedly, until a specified condition evaluates to false. It can be used for iteration if the number of iteration is fixed and known. The JavaScript loops are used to execute the particular block of code repeatedly. The ‘for’ loop is the most compact form of […]

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 […]

Scroll to top