Accessing array inside an object in javascript

function apple(){
  var data ={
    english:{},
    german:{}

};
  
data.english["name"] ="anil";
data.german["name"] ="sunil";
data.english["array"] = ["Ram Kumar",1,2,3,4,5,6,7];
  
  return data;
  
}


var x = apple();

console.log(x.english["array"][0]);


output : "Ram Kumar"

Popular posts from this blog

What are sales territory in Netsuite?

How to get and set a sublist in netsuite suitlet suitescript 2.0