Here is a object declaration: var o = {"foo-bar": 24}
Then, my question is how to access the property?
I forget it that I can access a object's property by using square brackets...
Here is a object declaration: var o = {"foo-bar": 24}
Then, my question is how to access the property?
I forget it that I can access a object's property by using square brackets...
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
</head>
<body>
<script type="text/javascript">
var o = {"foo-bar": 24};
alert(o['foo-bar']);
</script>
</body>
</html>