Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

protoypes in constructor functions in javascript

function Person() {
    this.name = 'John'
}

// adding property 
Person.prototype.name = 'Peter';
Person.prototype.age = 23

const person1 = new Person();

console.log(person1.name); // John
console.log(person1.age); // 23
Comment

PREVIOUS NEXT
Code Example
Javascript :: leaftjs 
Javascript :: typeorm sqlite Using Repositories 
Javascript :: desctructuring in react with aliases 
Javascript :: typeorm caching queries time limit by id 
Javascript :: how to use window.alert in javascript 
Javascript :: react js exoirt examoek 
Javascript :: npm resize div 
Javascript :: socket cheatsheet 
Javascript :: how to identify the li anchor tag text is empty in javascript 
Javascript :: node javascript retry promise.all 
Javascript :: if conprimido js 
Javascript :: getData(x, y, callback) and showData() callback function 
Javascript :: Allowed Blocks in Nested Blocks Component Wordpress 
Javascript :: javascript extrsct object 
Javascript :: Async functions and execution order 
Javascript :: what is render in react native 
Javascript :: nestjs cors dotnot woriking 
Javascript :: antd table access data from object //with dot 
Javascript :: js shufflin 
Javascript :: why is table.current.row.length not working 
Javascript :: get seo friendly url values in javascript 
Javascript :: browserlist nextjs 
Javascript :: avascript-how-to-detect-if-a-word-is-highlighted 
Javascript :: joomla add javascript 
Javascript :: codeigniter 4 tooltip dynamic 
Javascript :: parent.containts js 
Javascript :: salt has the same key in accepted and denied 
Javascript :: get form control value in angular 8 
Javascript :: loop through json object jquery 
Javascript :: pASS - EXE 
ADD CONTENT
Topic
Content
Source link
Name
7+9 =