Add property and value to the person object - Javascript Object

Javascript examples for Object:Quiz

Description

Add property and value to the person object

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<p id="demo"></p>

<script>
var person = {firstName:"A", lastName:"B", country: "USA"};
document.getElementById("demo").innerHTML = person.country;
</script>/*from  w  ww .  jav  a2s  .co m*/

</body>
</html>

Related Tutorials