Different Ways to Duplicate Objects in JavaScript

It turns out there are a lot of different ways to duplicate objects Photo by James Orr on Unsplash In JavaScript, a variable can store two types of data: Primitive Reference When we copy primitive values, only the value will be copied. var a = 10; var b = a; console.log(a, b); // 10, 10 b …

Learn TypeScript:Part 2 → Type declaration.

Learn basic features of typescript Create a new file with extenstion .ts ,say add.ts In that file we will create a variable a , then assign different types of values then see what typescript says When we compile the code using tsc add.ts . It generates a.js file in the same folder . And it doesn’t reports any error. So …

Learn TypeScript . Part 1.

First part in learning TypeScript. What is TypeScript ? TypeScript is modern JavaScript + types . TypeScript is an open-source programming language developed and maintained by Microsoft. Typically Typescript is Javascript with types. So that the type error and some of data type related bugs can be resolved . It is highly useful in large projects. Why TypeScript? …

Design a site like this with WordPress.com
Get started