javascript - Writing key and value in json -


this question has answer here:

i new javascript. can write json follows

const obj1 = {key: "mykey", value: "myvalue"}   const obj2 = {"mykey": "myvalue"} 

what difference between these two? , when should prefer using 1 on another?

the first 1 javascript way. second 1 json format. can use both in javascript. preference first way.


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -