Method Chaining in Action!
I'm finally getting to the point where my answers are pretty similar to a lot of the algos top 1 or 2 answers. This is my first "one-liner" I've been able to do in the last 2 months. I'm getting away from for loops as I try to challenge myself to solve them using the Array methods instead as I'm pretty comfortable with for loops as long as they're not nested. That "j" index is scary lol This isn't a difficult Algo by any means, but I've seen some cool ways to solve algos since I've been grinding the last 2 weeks and wanted to try new ways to get to the same result. Codewars link if you're curious: https://www.codewars.com/kata/5648b12ce68d9daa6b000099/solutions/javascript The biggest win was remembering that in the .map method you can directly access your nested array's elements using this syntax: var number = function(busStops){ return busStops.map( ([on, off]) => on - off).reduce( (acc, cur) => acc +=cur) } console.log(number([[10,0],[3,5],[5,8]])) The kata 7s are now being solved pretty quickly as I get back up to speed with all the different ways to iterate/"open" arrays. Getting my head around needing an array, variable, and for loop for everything is now slowly fading as I'm learning the redundancies in my code from all the other answers. Soon I'll be on your "one liner" level @Adelin Rosca hahaha