interview question what is javascript code example
Example 1: javascript interview questions
// Collection of data in key-value pairs
JAVASCRIPT OBJECTS
var obj1 = {
x: 43,
y: "Hello world!",
z: function(){
return this.x;
}
}
// Collection of data as an ordered list
var array1 = [5, "Hello", true, 4.1];
Example 2: javascript interview questions
class Person {
constructor(name) {
this.name = name;
}
}
var object = new Person("Sudheer");