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

What are the JavaScript Design Patterns

Design patterns are blueprint solutions to common programming problems. Most of the credit for classifying and describing the design patterns goes to the “Gang of Four” - Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides....

December 19, 2021 Â· 1 min Â· Coderslang Master

How to get access to the object property in JavaScript

There are 2 ways to get access to the object properties in JS: Dot notation: user.name Square bracket notation: user['name'] In both cases we’ll get access to the property name of the object user....

December 18, 2021 Â· 1 min Â· Coderslang Master

How to get dynamic access to an object property in JavaScript

To get started with the dynamic access to object properties in JS, let’s first take a look at how you could get access to a static object property. const user = { age: 25, name: 'Jack' } console....

May 7, 2022 Â· 1 min Â· Coderslang Master

How to get query params in Express

In Express.js all the query parameters are stored in the object req.query, so you can access them in any of your route handlers or middleware functions. So imagine your Express backend is running on https://learn....

December 16, 2021 Â· 1 min Â· Coderslang Master

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