[JSC] Implement Array.prototype.flatMap and Array.prototype.flatten