JavaScript基礎-オブジェクト-

2023-04-02

const human = {
name: ['Shiki’, 'BM’],
age: 26,
gender: 'male’,
interests: {
game: 'FPS’,
music: 'EDM’
}
};

ドット記法
human.age = 22;
ブラケット記法
human['age’] = 22;

const ageKey = 'age’;
human[ageKey] = 22;

日記

Posted by シキ