skip to Main Content

Javascript Object.Create() not having default values

Resources I've read https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/create Object.create not working as expected I have a simple script const defaults = { allowInputStyleChange: true }; var entry = Object.create(defaults); console.log(JSON.stringify(defaults)); console.log(JSON.stringify(entry)); This results in {"allowInputStyleChange":true} {} I was expecting {"allowInputStyleChange":true} {"allowInputStyleChange":true} Am I understanding…

VIEW QUESTION
Back To Top
Search