07-08-2022 JS

PHOTO EMBED

Sun Aug 07 2022 11:28:33 GMT+0000 (Coordinated Universal Time)

Saved by @samee #javascript

var add = (a,b) => { return a+b }; 
class Student {
    constructor(name,age,sex) {
        this.name = name;
        this.age = age;
        this.sex = sex;
    }
    getDetails() {
        return `${this.name}, ${this.age}, ${this.sex}`;
    }
}

var obj = {
    fun : function() {
        console.log('fun');
    }
}

var s= new Student('samee', 29, 'Male');
console.log(typeof(obj));

var scope = "global scope";
function check() 
{
    var scope = "local scope"; 
    function f() 
    { 
         return scope; 
    }
    return f();
}

console.log("A" - "B")

for(let i=0;i<3;i++) {
  setTimeout(() => console.log(i), 0);  
}

var t = check()
console.log(t);
content_copyCOPY

https://www.programiz.com/javascript/online-compiler/