Upgrade to Pro — share decks privately, control downloads, hide ads and more …

JSON.stringify()

 JSON.stringify()

JSON日の金曜日 #12の発表資料

D8eb514404fbca5bd485040edccdbe30?s=128

Matsui Masashi

September 13, 2019
Tweet

More Decks by Matsui Masashi

Other Decks in Programming

Transcript

  1. JSON.stringify() @circled9 2019-09-13 Friday 13 JSON #12  

  2. None
  3. Matsui Masashi দҪਖ਼ࢤ DJSDMFE ϒϥ΢β͕޷͖ͳਓ !XBUFSDFMMJOD !3

  4. JSON.stringify()  

  5. JSON.stringify() is … • JavaScriptͷؔ਺ • ΦϒδΣΫτΛJSONʹม׵͢Δ • JSONΦϒδΣΫτͷ࣋ͭؔ਺ͷதͰ3ຊͷࢦ ʹೖΔਓؾͷؔ਺

     
  6.  

  7.  

  8. arguments  

  9. JSON.stringify(value[, replacer[, space]])  

  10. arguments • value • any • replacer: optional • Array<String

    | Number> | function • space: optional • String | Number  
  11. value  

  12. value • JSONจࣈྻʹม׵͢Δ஋ɻ  

  13. replacer  

  14. replacer • ग़ྗ͢ΔJSONจࣈྻͷ੍ޚΛߦ͏ • Array<String | Number> • JSONจࣈྻʹؚΊΔϗϫΠτϦετ •

    Function: function(key, value) • JSONจࣈྻʹม׵͢Δ࣌ͷؔ਺  
  15. space  

  16. space • ग़ྗ͢ΔJSONจࣈྻͷۭനΛ੍ޚ͢Δ • Number • ۭനจࣈͷ਺ • String •

    ۭനͱͯ͠࢖༻͢Δจࣈྻ  
  17. ·ͱΊ  

  18. ·ͱΊ • JSON.stringify() ͸JSONΦϒδΣΫτͷؔ਺ ͷதͰ3ຊͷࢦʹೖΔਓؾͷؔ਺ • ୈ2Ҿ਺͕࣮͸ߴػೳ • Ͱ΋ɺ݁ہ JSON.stringify(obj,

    null, 2) Ҏ֎ ࢖͏͜ͱ͸΄ͱΜͲͳ͍