<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="ja">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="Content-Style-Type" content="text/css">
<meta name="GENERATOR" content="JustSystems Homepage Builder Version 18.0.14.0 for Windows">
<title>JavaScript練習中!</title>
</head>
<body background="y8b.gif">
<?php
require_once ("newpage8.php");
print $APPTITLE;
MyTitlePrint("連想記憶配列、実験開始!");
?>
<script>
<!--
//ここにJavaScriptを書くよー
const superHeroes = {
"squadName" : "Super hero squad",
"homeTown" : "Metro City",
"formed" : 2016,
"secretBase" : "Super tower",
"active" : true,
"members" : [
{
"name" : "Molecule Man",
"age" : 29,
"secretIdentity" : "Dan Jukes",
"powers" : [
"Radiation resistance",
"Turning tiny",
"Radiation blast"
]
},
{
"name" : "Madame Uppercut",
"age" : 39,
"secretIdentity" : "Jane Wilson",
"powers" : [
"Million tonne punch",
"Damage resistance",
"Superhuman reflexes"
]
},
{
"name" : "Eternal Flame",
"age" : 1000000,
"secretIdentity" : "Unknown",
"powers" : [
"Immortality",
"Heat Immunity",
"Inferno",
"Teleportation",
"Interdimensional travel"
]
}
]
}
document.write(superHeroes.homeTown + "<BR>");
document.write(superHeroes['members'][1]['powers'][2]);
document.close();
//-->
</script>
<?php
print "$APPFOOTER";
?>
<p><a href="JavaScriptMenu.php">JavaScriptMenuへ</a></p>
</body>
</html>
ネットから拾ったもので、そのままです。後から気が付きましたが、連想記憶配列ですね。