JSFiddle - React, Tailwind, and code Playground
JavaScript
const stuff = {}
function test(key){
function foo(){
return 1
}
stuff[key] = foo
return foo()
}
test("a")
test("b")
document.write(stuff.a === stuff.b)
const stuff = {}
function test(key){
function foo(){
return 1
}
stuff[key] = foo
return foo()
}
test("a")
test("b")
document.write(stuff.a === stuff.b)