Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:138.0) Gecko/20100101 Firefox/138.0
Firefox 138
Mac OS X 10.15
Desktop
one year ago
Benchmark.js
Reduce but with optimized parameters
313K/s
Reduce
217K/s
Join only valid strings
157K/s
Reduce but no template string
152K/s
Push valid to array and join
132K/s
Filter and reduce
96K/s
Filter and join
95K/s
Join and replace false
88K/s
View exact numbers
Test name Executions per second
Reduce but with optimized parameters 312,998 Ops/sec
Reduce 217,432 Ops/sec
Join only valid strings 156,994 Ops/sec
Reduce but no template string 152,461 Ops/sec
Push valid to array and join 132,166 Ops/sec
Filter and reduce 95,545 Ops/sec
Filter and join 94,561 Ops/sec
Join and replace false 88,116 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests: