System Verilog Array Methods Javascript Map Vs Foreach