LoginSignup
26
24

More than 5 years have passed since last update.

[JavaScript] 連想配列の扱い方

Last updated at Posted at 2014-08-06
  • 宣言
var hashItems = [];
var hashItems = new Array();
  • 追加
hashItems['key1'] = value1;
  • キーの存在チェック
if ('key1' in hashItems) {

}

if (hashItems['key1']) {

}
  • 削除
delete hashItems['key1'];
  • JSON 形式に変換
var jsonString = $.stringify(hashItems);
  • 参考文献

連想配列の定義など

26
24
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
26
24