Exercise on Variable and Arrow Function || Variable and Arrow Function in TypeScript
In this video,I explained a simple exercise in variable and arrow function concept in TypeScript.
Feel free to comment. For more, please subscribe and press the BELL icon. Please visit my Angular Playlist. Please visit my YouTube Videos. The code is as follows -
exercise_variable.ts -
// Create a simple and easy mathematical calculator
let p: any;
let q: any;
p= 30;
q= 10;
console.log("The Mathematical Calculator :- ");
console.log("The addition is: - " + (p+q));
console.log("The substraction is: - " + (p-q));
console.log("The multiplication is: - " + (p*q));
console.log("The division is: - " + (p/q));
console.log("The modulus is: - " + (p%q));
arrow_function.ts -
// arrow function is basically a function,
// where we will NOT use the 'function' key
// => - symbol
let check = (msg) => { //multiple lines
console.log(msg);
// ....
// ...
}
let check1 = (msg1) => console.log(msg1); //single line
Comments
Post a Comment