Javascript - Write program to Use the length property to add a new item to an array.

Requirements

Use the length property to add a new item to nameList: Oracle.

Here is the array

var nameList = ["Java", "XML", "Json"];

Hint

Syntax hint

array[array.length] = "item";

Demo

var nameList = ["Java", "XML", "Json"];
console.log( nameList );//from   ww w.j av  a  2 s.  co  m
nameList[nameList.length] = "Oracle";
console.log( nameList );

Result