Skip to content

Instantly share code, notes, and snippets.

View kotAPI's full-sized avatar
🎯
Focusing

Pranay Kothapalli kotAPI

🎯
Focusing
View GitHub Profile
function someFunction(){
console.log("I am a :" + this.thing);
console.log(this.somethingElse);
}
var object = {
thing : "programmer",
somethingElse:"somethingElse"
}
var Company = function(name,worth){
return{
name:name,
worth:worth,
getNetWorth:function(){
console.log("Name: "+this.name +", Worth :"+this.worth);
},
company2:{
name:"Acquired Company",
worth:"2Bn",
var InventoryDetails = function(obj){
obj.GetInventoryDetails = function(){
console.log("You are "+this.name+ " and you have "+ this.pencils + " pencils and "+ this.pens+ " pens.");
}
}
var JackInventory = {
name:"Jack",
pencils:264,
pens:23
var myObject = {
name: "Matt Murdock",
age: 28,
callFunction:function(){
console.log("My name is "+ this.name + " and I’m " +this.age+ " years old."
}
}
myObject.callFunction();
//=> My name is Matt Murdock and I'm 28 years old.