JSON Examples

1- Object Properties

Output

JS

var Person = {
        firstName:  'Joe',
        midName:    'Alan',
        lastName:   'Dokes',
        age:        '35'
    }

HTML

<script>
    let outputHTML = ' ';

    outputHTML += 'First: ' + Person.firstName + '<br>';
    outputHTML += 'Middle: ' + Person.midName + '<br>';
    outputHTML += 'Last: ' + Person.lastName + '<br>';
    outputHTML += 'Age: ' + Person.age  + '<br>';

    document.getElementById('info').innerHTML = outputHTML;
</script>