Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

what does the text before an object stand for in js

function Foo(who) {
	this.me = who;
}
Foo.prototype.identify = function () { 
	return "I am " + this.me; 
}

function Bar(who) { 
	Foo.call(this, who); 
}

Bar.prototype = Object.create(Foo.prototype); // __proto__: Foo.prototype

/*
	This will print only "Foo" because the object doesn't have any properties
    apart from __proto__. "Foo" is the name of the function, of which
    part is the prototype.
*/
console.log(Bar.prototype);
Comment

PREVIOUS NEXT
Code Example
Javascript :: css to jss 
Javascript :: js get first elements of array 
Javascript :: communicate between content script and bg 
Javascript :: board in javascript 
Javascript :: how to return data from function in javascript 
Javascript :: success res node.js 
Javascript :: save to text or html file very good 
Javascript :: check if first array contains all elements javascript 
Javascript :: Hardhat deploy sample js code 
Javascript :: add text to each element in an array javascript 
Javascript :: react users list modal 
Javascript :: prisma get single data query 
Javascript :: mongodb function example 
Javascript :: var logEvenNums = function(num) {}; 
Javascript :: how to create existing nodes in godot 
Javascript :: discord.js create a private channel 
Javascript :: angular file upload code anji 
Javascript :: ES6 reactjs problems 
Javascript :: filter function in javascript 
Javascript :: how to scroll element in javascript 
Javascript :: jquery if element has multiple classes 
Javascript :: javascript promise example 
Javascript :: ~~ in js 
Javascript :: Remove uploaded file in jquery 
Javascript :: how to pause settimeout in javascript 
Javascript :: .net core json store data type in model oracle 
Javascript :: loop,array javascript 
Javascript :: JavaScript Precision Problems 
Javascript :: date methods javascript 
Javascript :: javascript even/uneven numbers 
ADD CONTENT
Topic
Content
Source link
Name
6+9 =