logo
  • 教程列表
  • SO官方文檔
  • JSON
    • 解析具有復活功能
    • 序列化一個值
    • 序列化和恢復類例項
    • JSON 與 JavaScript 文字
    • 使用 replacer 功能進行序列化
    • 解析一個簡單的 JSON 字串
    • 迴圈物件值
  1. StackOverflow 文件
  2. JavaScript 教程
  3. JSON
  4. 解析一個簡單的 JSON 字串

解析一個簡單的 JSON 字串

Created: November-22, 2018

JSON.parse() 方法將字串解析為 JSON 並返回原始 JavaScript,陣列或物件:

const array = JSON.parse('[1, 2, "c", "d", {"e": false}]');
console.log(array); // logs: [1, 2, "c", "d", {e: false}]
  • 迴圈物件值
  • 使用 replacer 功能進行序列化

Copyright © 2018. All right reserved

tastones.com 备案号:鲁ICP备18045372号-1

  • 關於本站
  • 免責聲明