Skip to content

Latest commit

 

History

History
19 lines (16 loc) · 984 Bytes

6.md

File metadata and controls

19 lines (16 loc) · 984 Bytes

Broken Pipe

You have the next pipeline:

console.log('The result is ' + [...Array(5)]
  .method((a, b) => [1 + b])
  .method((a, b) => Array.from(a))
  .method((a, b) => [...Array(a)])
  .method((a, b) => [a.length])
  .method((a, b) => [1 + a])
  .method((a, b) => a && b)
  .method((a, b) => a += b)
);

This pipeline should print into console "The result is 15". Replace all methods with the next operations: map (3), flatMap (3), filter (2), reduce (1). So one of them is excess.

Tip: This pipeline is not what it seems.

Solved here