How do I encode a JavaScript object as JSON?

后端 未结 2 1862
离开以前
离开以前 2020-11-28 11:23

Is there a good way to encode a JavaScript object as JSON?

I have a list of key value pairs...where the name is from a checkbox, and the value is either true or fals

2条回答
  •  囚心锁ツ
    2020-11-28 12:17

    I think you can use JSON.stringify:

    // after your each loop
    JSON.stringify(values);
    

提交回复
热议问题