Scans an array by applying a LAMBDA to each value and returns an array that has each intermediate value