|
|
|
|
|
by nine_k
674 days ago
|
|
Certainly so! The first example is needlessly contrived. But instead of for (const i=0; i < data.length; i++) {
new_data[i] = old_data[i].toUpperCase();
}
you can write const new_data = old_data.map((x) => x.toUpperCase());
I think it's both more clear and less error-prone. |
|