JavaScript 2

 <!DOCTYPE html>

<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <button id="delete" >Delete</button>
</body>
<script>
    //onclick="Delete();"
//alert('Hello');
// let name=prompt("Please Enter your name.");
// alert(`Hello ${name} !`)

let a=prompt("enter A number");
let b=prompt("enter b number");
alert(parseInt(a)+parseInt(b));


document.getElementById('delete').addEventListener('click',function(){
Delete();
});

function Delete(){
    let result=confirm("Are you sure delete this file?");

    if(result){
        document.write("delete file Success.")
    }
}

console.log("Simple log");
console.error("Simple error");
console.info("Simle info");
console.warn("Simle warn");

const student=[
    {
        name:'sabir',
        roll:1001,
        class:11
    },
    {
        name:'tejas',
        roll:1002,
        class:11
    },
    {
        name:'prem',
        roll:1003,
        class:11
    }
];

console.log(student);
//Array to string
let jsonString= JSON.stringify(student);
//string to array
let jsonArray= JSON.parse(jsonString);

console.log("Json String:"+jsonString);
console.log("Json array:"+jsonArray);
console.log(jsonArray);

console.table(student);
console.assert(2<1,"Ha bhai bada hai");


for(let i=0;i<10;i++){
    console.count("Hello");
}

// console.time("Start");
// let j=0
// while(j<=20000){
//     console.log(j);
//     j++;
// }
// console.timeEnd("End");







</script>
</html>

Comments

Popular posts from this blog

App 1st User Define Component

Example 1

Rabiit