JavaScript

JavaScript sleep() Function

JavaScript sleep() Function | The sleep(sec) function is available in programming languages like PHP and C to suspend the execution for a set period. Java thread contains the sleep() method. Similarly, Python has time, where can we use sleep(). In contrast to other languages, JavaScript lacks a sleep() function. We can simulate the JavaScript sleep()

JavaScript sleep() Function Read More »

Truthy Falsy in JavaScript

Truthy Falsy in JavaScript | The JavaScript language has a few peculiarities we need to be aware of, and comparing two items to see if they are equal will frequently catch the unwary developer off guard. This tutorial will examine why that is while exploring the double and triple equals operators and the idea of

Truthy Falsy in JavaScript Read More »

Shorthand If Else in JavaScript

Shorthand If Else in JavaScript | Employing the ternary operator to use a shorthand for an if-else statement. The ternary operator begins with a condition, which is then continued by a question mark ‘(? )’, a value to be returned if the condition is true, a colon ‘(:)’, and a value to be returned if

Shorthand If Else in JavaScript Read More »