Following are the key points described later in this article:
Use the instructions on following page to setup the TypeScript development environment. Docker – How to setup Typescript Development Environment
interface Person {
firstname: string;
lastname: string;
}
function hello(person: Person) {
return "Hello, " + person.firstname + " " + person.lastname;
}
var calvin = {firstname: "Calvin", lastname: "Hobbes"};
var chris = {firstname: "Chris", lastname: ""};
console.log(hello(calvin));
console.log(hello(chris));
Name the above program as “hello.ts”. Compile it using the command, “tsc hello.ts”. It would create the file “hello.js”. Execute the “hello.js” using node runtime using following command:
node hello.js
It would print following:
Hello, Calvin Hobbes
Hello, Chris
Last updated: 2nd May, 2024 The success of machine learning models often depends on the…
When working on a machine learning project, one of the key challenges faced by data…
Last updated: 1st May, 2024 The bias-variance trade-off is a fundamental concept in machine learning…
Last updated: 1st May, 2024 As a data scientist, understanding the nuances of various cost…
Last updated: 1st May, 2024 In this post, you will learn the concepts related to…
Last updated: 26th April, 2024 In this blog post, we will discuss the logistic regression…