5 articles has "javascript" tag
- 1
A deep and pragmatic guide to the
<
,>
,<=
and>=
comparison operators of JavaScriptRead moreThese four operators as you might have guessed are used for comparing values in JavaScript. The names of these operators are:
Operator Name >
Less than >
Greater than <=
Less than or equal >=
Greater than or equal - 2
Don't use
window.event
Read moreSuppose you have the following HTML and JavaScript:
<button id="btn">Click me</button>
let myBtn = document.querySelector("#btn"); myBtn.addEventListener("click", () => { console.log(event); });
What do you think clicking on the button will happen?
- 3
Rest parameters of JavaScript
Read moreHave you ever dreamed of creating your own JavaScript function that can accept any number arguments? Today we will learn how to do that with modern JavaScript syntax. And as you might already have guessed: the name of that syntax is rest parameter.
- 4
Template literals and tagged template literals
Read moreTemplate literals are a handy way to include any values inside of a string. With template literal you always get a string value. Tagged template literals give you complete freedom over the return value of a template literal and gives you access to the parts of it through a function called the tag function.
- 5
Find out Fibonacci sequence in JavaScript with one line of code
Read moreFibonacci sequence is very easy to think of. The first two terms are $0$ and $1$ respectively. And any later term is the sum of previous two terms. So it grows like below: