Oh JavaScript “Return” should Inline

Yudi Supriyadi
Feb 12, 2021

--

There is bug in code below.

export function convert() {
return
array.map((item) => +item)
}

The function return undefined instead of array. I was confused and wasted my time that caused by the syntax error. So funny. Yeah the problem is those statements should in same line.

export function convert() {
return array.map((item) => +item)
}

FIX.

--

--

No responses yet