Javascript list object
JavaScript: List the properties of a JavaScript objectLast update on February 26 2020 08:09:06 (UTC/GMT +8 hours)JavaScript Object: Exercise-1 with SolutionWrite a JavaScript program to list the properties of a JavaScript object. Show Sample Solution: - HTML Code: JavaScript Code: Sample Output: ["red","green","white"]Flowchart: Live Demo: See the Pen javascript-object-exercise-1 by w3resource (@w3resource) on CodePen. Contribute your code and comments through Disqus. Previous: javascript Object Eexercises. What is the difficulty level of this exercise? Easy Medium HardTest your Programming skills with w3resource's quiz. JavaScript: Tips of the DayMerge/flatten your arrays in arrays There's a nice method for Array called Array.flat, as an argument it needs depth you need to flat (default: 1). But what if you don't know the depth, you need to flatten it all. We just put Infinity as the argument. Also there's a nice flatMap method. const arrays = [[10], 50, [100, [2000, 3000, [40000]]]]; arrays.flat(Infinity); // [ 10, 50, 100, 2000, 3000, 40000 ]Ref: https://bit.ly/3o5iTBb
|