「JSON」javascriptオブジェクトでjson配列を取得する
書式
const 変数名 = jsonデータ
変数名.json属性
使用例
<!DOCTYPE html>
<html>
<body>
<h2>JavaScriptオブジェクトを取得</h2>
<div id="cft"></div>
<script>
//jsonデータの定義
const fObj = {username:"user007",
age:30,
city:"東京"};
//セレクタ名cftにjsonデータのusernameを表示
document.getElementById("cft").innerHTML = fObj.username;
</script>
</body>
</html>