Web
Analytics
type script for loop | Angular | ASP.NET Tutorials

For Consultation : +91 9887575540

Stay Connected :

type script for loop

//For Of Example
var myfun = () => {
    var num: number[] = [2, 3, 10, 19]

    for (var item of num) {
        console.log(item);
    }
}
function getdata(): any {
    alert('hello');
}
function getdata1(a: string, b: string, c: string='pratap nagar'): any {
    alert(a+b+c);
}

Index.html

<!DOCTYPE html>

<html lang="en">
<head>
    <meta charset="utf-8" />
    <title>TypeScript HTML App</title>
    <link rel="stylesheet" href="app.css" type="text/css" />
    <script src="app.js"></script>
</head>
<body>
    <h1>TypeScript HTML App</h1>

    <div id="content"></div>
    <input type="button" onclick="myfun()" name="name" value="Call Function" />
    <button onclick="getdata()">Call</button>
    <button onclick='getdata1("yogesh","sharma","Krishna Vihar")'>Call</button>
</body>
</html>