July 2018
Intermediate to advanced
420 pages
8h 46m
English
The any type is very useful when we do not know what to expect from a function (in other words, when we do not know which type we are going to return):
let band: any;band = { name: "Motorhead", description: "Heavy metal band", rate: 10}console.log(band);band = "Motorhead";console.log(band);Note that the first band assignment is an object, while the second is a string.
tsc any.ts
node any.js
You will see the following message in the Terminal:
{ name: 'Motorhead', description: ...Read now
Unlock full access