Relative Content

Tag Archive for javascriptarraysobject

Find case-insensitive substring in array of objects within array of objects in JavaScript

I’m not sure how to deal with nested arrays and objects in JavaScript. I need to check if any of the Titles – whether the main folder Title or the Title within Contents – include a certain case-insensitive word (information in the sample code). It can stop checking as soon as it finds the word in any Title. I need to skip over/ignore the Description.

Why I get undefined? I need help. Thank you

const users = { user1: 18273, user2: 92833, user3: 90315 } //Answer const usersArray = Object.entries(users).map((keys, value)=> {return keys[0] + ‘ ‘ + value[1]}); console.log(usersArray); //OUTPUT: [‘user1 undefined’, ‘user2 undefined’, ‘user3 undefined’] I expect it to be like this: [ [ ‘user1’, 18273 ], [ ‘user2’, 92833 ], [ ‘user3’, 90315 ] ] javascript arrays […]