DEV Community

Discussion on: Daily Challenge #50 - Number Neighbor

Collapse
 
savagepixie profile image
SavagePixie • Edited

So... something like this?

const neighbours = str => [ (parseInt(str) + 1).toString(), parseInt(str) - 1).toString() ]