JSFiddle - React, Tailwind, and code Playground

by shivaay123

JavaScript

const fruit = {
  name: 'Apple',
  location: 'Nepal',
}
function summ() {
  console.log(`${this.name} is found in ${this.location}.`)
}
const newSummary = summ.bind(fruit)
newSummary()

const fruit2 = {
  name: 'Mango',
  location: 'Terai',
}
newSummary.bind(fruit2)
newSummary()