
Recently, I got the chance to work on a backbone application where I understood the primary importance of selectively using javascript built-in objects for our operations regardless of the framework.

Most of the times we pledge our allegiance to our lords (frameworks) and libraries and follow them blindly because we think that they are capable of doing everything, sometimes losing out on javascript best practices. (Oh! The Internet is the deep blue sea I was talking about).Īs frontend developers most of the times we do not rely on vanilla javascript for everything that we want. Although most of us do not venture all the way down into the darkness, we still precisely like to get what we want. You are on a boat in the middle of a deep blue sea. Thank you for reading my blog.The internet is a great place to find information, but there is one teeny-tiny problem. Thank you for reading, and let's connect! See the Pen JavaScript find min/max from array of arrays by Chris Bongers ( CodePen. I created a CodePen demo where you can have a play with finding the min/max from an array of objects. This is needed so that the other value is always the current. You might also have spotted that for this to work, we had to swap around the previous/current check. reduce ( ( prev, cur ) => (prev?.age > cur.age ? prev : cur), null ) log ( 'highest', highest) // null // Or the shorthand: const highest = users. Our array will look like this: const users = [, null ) console. Let's see how we can do the same with an array of objects. In the previous article, we looked at finding the min/max from an array of arrays. How to find the min or max value from an array of objects 17 Jul, 2022
