🚀 CYBER WEEK SALE: 50% OFF on JavaScript Fundamentals 💪

How to return a value from an async function in JavaScript

All JavaScript functions return something. However, if your function is async it’s going to return a Promise, so you can use the keyword await to get the value that the promise resolves to....

December 15, 2021 · 1 min · Coderslang Master

How to use Object.freeze in JavaScript

Object.freeze is a handy tool that helps you make an object immutable in JavaScript. Object.freeze(someObject); If you try use the delete keyword or an assignment operator = after freezing the object with Object....

December 14, 2021 · 1 min · Coderslang Master

How to Remove Properties or Fields from JavaScript Objects

You can remove properties (fields) from the JavaScript objects using the delete keyword. const user = { name: 'John', age: '25', isLearning: true }; delete user.age; delete user['isLearning']; console.log(user.name); // John console....

December 13, 2021 · 1 min · Coderslang Master

Redirect to another page with JavaScript

If you want to redirect to another page with JavaScript, you can use the window.location object. This object is part of the window global object and has a property called href....

November 6, 2022 · 2 min · Coderslang Master

How to fix missing "use strict" error in JavaScript

A missing "use strict" error is common when you use ESLint. There are 2 possible fixes to it: add the statement “use strict” in double quotes as a first line in your JS file "use strict" //the rest of your JS code goes below // AND must be in a strict mode add a custom ESLint rule (as a comment!...

December 11, 2021 · 1 min · Coderslang Master

What does "use strict" do in JavaScript

The “strict mode” was introduced in ECMAScript 5. It allows you to put your script into the “strict” operating mode which prevents certain (potentially dangerous) operations. ES6+ classes and native ECMAScript modules have strict mode enabled by default....

December 10, 2021 · 1 min · Coderslang Master

How to remove a specific item from an array in JavaScript

The easiest way to remove a specific item from the JavaScript array is the splice method. ...

December 9, 2021 · 2 min · Coderslang Master

What does HTML stand for

HTML stands for HyperText Markup Language. It is a programming language for creating the structure and the contents of the website. Every website you visit including this one which you are reading right now is built with the help of HTML....

December 6, 2021 · 2 min · Coderslang Master

Which HTML tag is used to define an internal style sheet

The style tag is used to define an internal style sheet in an HTML file. It is the HTML element that adds CSS stylings directly into the HTML file. Inside the style tag, you can write CSS code as if you were in a CSS file....

December 3, 2021 · 2 min · Coderslang Master

How to change the color while hovering in CSS

To change the color when hovering in CSS, you will use the CSS selector called :hover. The :hover is a CSS pseudo-class that will select the HTML element when the user hovers over with the mouse....

December 2, 2021 · 2 min · Coderslang Master