0
Return an array
Why this code bellow doesn't return an array and instead return a function https://code.sololearn.com/W0chC51O4yjw/?ref=app
1 Answer
+ 2
The code prints a function because selectOne is a function. If you want the return value of said function, you need to invoke it (call it):
console.log(selectOne())
Note the added parentheses after 'selectOne'.