Skip to content
Advertisement

How use instead of comma in mapped list

My code–

JavaScript

this map function makes this format– [ord('1'), ord('2'), ord('3'), ...] from 1 to 9

But want like [ord('1') | ord('2') | ...]

How can i do that?

Advertisement

Answer

Try:

JavaScript

Note: instead of double map use a comprehension:

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement