Category:

typescript

Running TypeScript Scripts With Ease with ts-node

While not for everybody, TypeScript, as well as other strongly typed languages, have been gaining in popularity. With TypeScript being a superset of JavaScript, using it means transpiling your *.ts files down to pure JavaScript before the V8 engine can understand them. You could watch for file changes and automate the transpiling but sometimes you …
Read more

Object Rest and Spread in TypeScript

TypeScript 2.1 brings us object rest & spread to easily destructure, make shallow copies and merge objects into new ones. Object Spread Create shallow copy of objects: const names = {cat: ‘Bob’, dog: ‘Fred’, alligator: ‘Benedict’}; const newNames = { …names }; console.log(newNames.cat); // Bob You can merge multiple objects into a new object: const …
Read more