Skip to content

Commit e009885

Browse files
committed
Add map function to lists module
1 parent ed4dbcc commit e009885

File tree

1 file changed

+5
-0
lines changed
  • src/javascript/lib/core/erlang_compat

1 file changed

+5
-0
lines changed

src/javascript/lib/core/erlang_compat/lists.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,10 @@ function mapfoldl(fun, acc0, list1) {
143143
return new ErlangTypes.Tuple(listResult, accResult);
144144
}
145145

146+
function map(fun, list) {
147+
return list.map(value => fun(value));
148+
}
149+
146150
export default {
147151
reverse,
148152
foreach,
@@ -158,4 +162,5 @@ export default {
158162
keystore,
159163
keytake,
160164
mapfoldl,
165+
map,
161166
};

0 commit comments

Comments
 (0)