オブジェクトを扱う。分割代入とともに【Day72 of 100】

本日は計1件のコミットで作業を進めました。内容はその他の実装です。


① その他の実装

オブジェクトを扱う。分割代入する

見た目の中身は雛形のまま。コンソールを見ればすべて学習した内容が詰まっている。

https://kiyo4810.github.io/autocal/html_ver/index32.html

const hobby = 'dream';
const person = {
name: '小西',
age: 53,
greeting: function () {
return 'ようこそ芦屋へ';
},
const: 'const',
'current city': 'Ashiya',
3: 3.14,
52.5: 52.5,
1: 1,
[hobby]: ['ganpura', 'walking Rokuroku', 'music'],
0: 0,
};
console.log(person);
console.log(person.name);
console.log(person.age);
console.log(person['name']);
console.log(person['age']);
console.log(person['current city']);
console.log(person['3']);
console.log(person[hobby][1]);
console.log(person['greeting']());
console.log('---A');
for (const key in person) {
if (!Object.hasOwn(person, key)) continue;
console.log(key);
console.log(person);
const element = person[key];

今日の振り返り。

今の教材、最初1/5くらいから急激に難しくなった。いや、最初から難しかったけど流石にちんぷんかんぷんすぎる内容になってきた。

よく見たら初学者、入門編などというキーワードはどこにも入っていない、、、。

ということでこの教材は一旦ここで保留(ずっと使えるから自分のレベルが上がったら帰って来たい。それぐらいMECEにとても細かいところまで分かっている先生が教えてくれているのだけはよく分かる。)


今日の成果物 🎉

https://kiyo4810.github.io/autocal/html_ver/index32.html


コメントを残す

猫でデザインとプログラミングを学ぶをもっと見る

今すぐ購読し、続きを読んで、すべてのアーカイブにアクセスしましょう。

続きを読む