Javascript

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…

Read More

Javascript, NodeJS

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…

Read More

NodeJS

Javascript map, reduce and filter

javacript map, filter and reduce

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…

Read More

Angular

How to convert a bootstrap template to Angular

converting 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…

Read More

Typescript

Working with classes in typescript

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…

Read More

NodeJS

Running a NodeJS app with Typescript and ExpressJS in Docker Container

node and express with typescript in docker

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…

Read More

NodeJS

How to use Sequelize with Node and Express

NodeJS with Sequelize

If you are willing to use MySQL with your Node App, this guide will show you how to use Sequelize with Node and Express. In my opinion, Sequilize ORM is the best way to use MySQL with Node. Sequelize offers features like Migrations, Seeders and Relationship management. These features are handy when you are in need of a quick working…

Read More

Laravel

How to install Laravel with NGINX on Ubuntu

installing laravel with nginx on ubuntu

Laravel is the most popular PHP MVC framework. If you have chosen a VPS or cloud hosting to deploy your laravel website, this post will help you install Laravel with NGINX on Ubuntu. PHP 7.4 Ubuntu 20.04 Laravel 8.x PHP and PHP-FPM PHP-FPM is an advance level FastCGI process manager. More information on PHP-FPM is here. To install laravel with…

Read More