Destructuring in javascript is a syntax enhancement. It enables us to extract properties from object and create a dedicated variable for them. In this post, we will learn how to use destructuring in javascript to make the code more readable and concise. How to destructure an object in Javascript Lets create a simple javascript object person as follows: Without destructuring,…
Author: Zohaib Shah
Automate GitHub releases and generate release notes with release-it
A release in a software ecosystem is a way to package and version software at a specific point in time. GitHub releases are an efficient and standard way of packaging and distributing software. In this blog post, we will see how to create a GitHub release and automate it using the release-it npm package. We will also see how to…
Understanding pass by reference and pass by value in Javascript
A variable with primitive data type is passed by value in javascript. All non-primitive data types such as arrays and objects are passed by reference in javascript. Following are the examples of primitive data types in javascript: All above primitive data types variables are passed to functions by their values. Let’s understand this with some code examples. Pass by value…
Understanding null coalescing and ternary operator with truthy and falsy values in Javascript
Understanding how javascript evaluates different values as truthy or falsy is an essential need in day to day coding. Truthy and falsy values in javascript are used in if blocks, ternary and OR (||) operators and null coalescing (??) operator. To understand truthy and falsy values in javascript, we will declare multiple variables of different types. To check for exact…
Javascript map, reduce and filter
Javascript map, reduce and filter functions are some of the useful array functions in javascript. These are the higher order functions which takes a callback function as their parameter. Javascript map() function The javascript map() function is an array function which iterates through the array and executes the provided callback on each element. The map function returns an array which…
How to convert a bootstrap template to Angular
In this post, we will learn how to convert any bootstrap template to angular. “Clean Blog” on startbootstrap.com seems to be a good choice as long as we are keen to understand the process of converting a bootstrap template to angular. We can download the template from this link. 1- Setting up Angular app First of all, check if you…
Working with classes in typescript
Working with classes in typescript is essential to write readable and reusable code. In this short article, we will understand classes in typescript in simplest way possible. For the sake of simplicity, we will write all code in one ts file. You only need to have typescript installed globally to compile this ts file. Writing a class in typescript: Let’s…
Running a NodeJS app with Typescript and ExpressJS in Docker Container
In this blog post, I will walk you through the simplest way of setting up a nodejs application with expressjs and typescript to run inside a docker container. Git repository for this post is available here. We will complete the setup by following below steps: Creating a simple NodeJS application with express. Adding typescript support to express app Containerize express…
Simple Login and Registration with ExpressJS, Sequelize, bcrypt and JWT
In this guide, we will see how a NodeJS and MySQL web application can incorporate user registration and login feature. We will use bcrypt to hash the password and JWT for token generation. In this post, we will not create any HTML page or template. Instead, We should consider it as a process to add login and registration functionality in…
Seeding data in MySQL table using Sequelize and faker.js in NodeJS
In this guide, We will learn about seeding data in MySQL table using Sequelize ORM and faker.js. Seeding a table simply means adding fake data in the database for testing and demonstration purposes. In our last post, we did setup Sequelize with NodeJS application and created the table Users. We should start from there and add more columns to the…