class Language {}
const l1 = new Language();
console.log(l1.constructor.name);
const Season = [
{
month:'January',
season: 'Winter',
},
{
month:'March',
season: 'Spring',
},
{
month:'June',
season: 'Summer',
},
{
month:'August',
season: 'Autumn',
},
]
const index = Season.findIndex( (loopVariable) => loopVariable.month === 'March');
console.log("The index of March Month is",index)
const Season = [
{
month:'January',
season: 'Winter',
},
{
month:'March',
season: 'Spring',
},
{
month:'June',
season: 'Summer',
},
{
month:'August',
season: 'Autumn',
},
]
const index = Season.map( (loopVariable) => loopVariable.month).indexOf
("March"));
console.log("The index of March Month is",index)
class Language {
getClassName() {
return this.constructor.name;
}
}
const l1 = new Language ();
const objClassName = l1.getClassName();
console.log(objClassName);
var what = function(obj) {
return obj.toString().match(/ (w+)/)[1];
};
class Dog{}
var dog = new Dog();
if(dog instanceof Dog){
console.log("Is dog");
}