Aristocrat --

learn classes and oops concept in js 



// const arr=[1,2,3]



// interface puppy{

//   color:String

// }


// interface cat extends puppy{

//   legs: Number 

// }


//Sort this array of objects by key


// var ob = [

//   { "abc": 100 },

//   { "mno": 200 },

//   { "def": 100 },

//   { "pqr": 500 }

// ]

  

// const res=ob.map((el)=>Object.keys(el)[0]);


// let ans= res.sort().reduce((acc,curr)=>{

//   acc[curr]= ob.find((el)=>Object.keys(el)[0]===curr)[`${curr}`]

//   return acc;

// },{})

// console.log([ans])



const obj ={

  name:'Ankit',

  printName:function(

   console.log(this.name)

  )

}


const obj2 ={

  name:'Ankidddt'

}


obj.printName.call(obj2)


//call ,apply -->

// printName.call(thisArg,'state','')

// printName.apply(thisArg,['',''])


//






















Comments

Popular posts from this blog

TO the new

4048