1

I want to push objects to an array but it should not convert keys of objects to strings. Is there any way to push objects to an array without affecting keys.

/// required value:
const myArray = [
{title:'my array'}
]
/// instead gets 
const myArray = [
{'title':'my array'}
]
  • 3
    object keys are by definition always strings. There is no actual difference between the two values you've shown (although when defining it yourself it's more convenient to leave out the quotes) – Robin Zigmond Mar 27 '21 at 19:09

0 Answers0