create an object constructor javascript
function ClassMates(name,age){
this.name=name;
this.age=age;
this.displayInfo=function(){
return this.name + "is " + this.age + "year's old!";
}
}
let classmate1 = new ClassMates("Mike Will", 15);
classmate.displayInfo(); // "Mike Will is 15 year's old!"function Tree(name) {
this.name = name
}
let theTree = new Tree('Redwood')
console.log('theTree.constructor is ' + theTree.constructor)
Also in JavaScript:
- get file extension of path extendscript
- javascript unset
- map a square to a circle
- build an api in nodejs using express to send emails using the gmail rest api without client libraries
- javascript repeat each second
- How to fix WordPress jQuery is not defined
- append string in variable using jquery in each loop
- what is nodes and hubs in selenium grid
- discord.js start code
- sequelize create record with foreign key constraint
- react.createref()
- change id in jquery
- js for each item do
- age validation jquery
- remove property from javascript object
- Node require module
- jQuery select elements by name
- 404 json laravel
- angular themeable components
- behaviorsubject in angular 10
- Jquery SEND TO START OF ARRAY
- nodejs get file size
- js change contenteditable value
- javascript scroll to bottom