Learn the language of the web.

Recent Post

Get user location by IP address with JavaScript

Location by IP can resolved by a third-party service or in Node.js.

Typewriter typing effect with JavaScript

Make text appear on screen as if it is being typed live using the setInterval() function!

How to read and display a PDF using JavaScript

The native FileReader API can be used to read a PDF and create a URL to its contents.

What’s wrong with using ‘var’ in JavaScript?

Using 'var' to declare variables can lead to scope leakage and silent errors in your code.

How to exit a JavaScript function

A JavaScript function can be exited by using the 'return' keyword or throwing an error.

How to exit a loop in JavaScript

You can exit from the execution of a loop by using the 'break' keyword.

Semicolons in JavaScript: Are they necessary?

Semicolons are often optional, but sometimes their omission can break code!

Styling HTML Elements with JavaScript

JavaScript can style HTML elements directly or indirectly via the class attribute.

Using JSON in JavaScript

With JSON, you can store a JavaScript native object in pure string format.

Using HTML data attributes in JavaScript and CSS

Data attributes allow you to store string data directly on HTML elements.