Answer the question
In order to leave comments, you need to log in
How to get an element from an array?
All good.
Please tell me how to get the element "123" from the array:
var mass= [
{input: [0], output: [1]}, //1
{input: [1], output: [1]}, //2
{input: [123], output: [0]}, //3
{input: [0], output: [1]}, //4
{input: [0], output: [1]}, //5
{input: [0], output: [1]}, //6
{input: [0], output: [1]}, //7
{input: [0], output: [1]}, //8
{input: [0], output: [1]}, //9
{input: [0], output: [1]} //10
];
Answer the question
In order to leave comments, you need to log in
If there is a search task, then for example:
console.log( mass.find(function(item){ return item.input[0] == 123; }) );
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question