-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvariableMe.js
37 lines (37 loc) · 925 Bytes
/
variableMe.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var greeting = "Hello World";
console.log(greeting);
// number
var userId = 3222.2;
userId.toFixed();
// boolean
var isLogin = true;
//any
var login;
function getHero() {
return "Thor";
}
login = getHero();
function userLogin(name, email, password, isPaid) {
}
userLogin("Kyaw San Maung", "[email protected]", 3325, false);
// Function control in TypeScript
var addTwoNumber = function (num1) {
return num1 + 2;
};
var myValue = addTwoNumber(8);
// Function control more than one type number or string or boolean
// Case One
// function getValue(myValue: number):boolean {
// if (myValue > 5) {
// return true;
// }
// return "200 ok"
// }
// Map practise with array
var Heros = ["SpiderMan", "Iron Man", "Thor", "Hulk"];
// const Heros = [1, 2, 3, 4];
Heros.map(function (hero) {
return "I am ".concat(hero, ".");
});