Newbie JSON question

Hello,
I’m trying to learn basic JavaScript and JSON. I’ve got the following:

<input type='text' id='one'>
<input type='text' id='two'>
<input type='button' id='store' value='store' >

<script>
var iOne = document.getElementById('one');
var iTwo = document.getElementById('two');
var names =  [];
var eOne = document.getElementById('store');
eOne.addEventListener('click',buttonOp);

function buttonOp() {  
        var anObject = { fName: iOne.value, lName: iTwo.value };
        names.push(anObject);
        for( var x=0; x<names.length; x++)
            console.log("names[" + x + "]:"  + names[x].fName + " " + names[x].lName);
}
</script>

Am I actually using JSON? To a newbie like me it seems to be an array holding JavaScript objects.

Thanks for any advice,
Gerard

That part is JSON (JavaScript Object Notation)

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.