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);
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter