Skip to main content
deleted 20 characters in body
Source Link
l4m2
  • 32.5k
  • 2
  • 26
  • 116

JavaScript (Node.js), 30 bytes

a=>eval(`[${a}]`).filter(evalx=>1)

Try it online!

Assume no zero inputTry it online!

JavaScript (Node.js), 39 bytes

a=>((a+'').match(/\d+/g)||[]).map(eval)

Try it online!

Assume no negative input

JavaScript (Node.js), 30 bytes

a=>eval(`[${a}]`).filter(eval)

Try it online!

Assume no zero input

JavaScript (Node.js), 39 bytes

a=>((a+'').match(/\d+/g)||[]).map(eval)

Try it online!

Assume no negative input

JavaScript (Node.js), 30 bytes

a=>eval(`[${a}]`).filter(x=>1)

Try it online!

JavaScript (Node.js), 39 bytes

a=>((a+'').match(/\d+/g)||[]).map(eval)

Try it online!

Assume no negative input

added 480 characters in body
Source Link
l4m2
  • 32.5k
  • 2
  • 26
  • 116

JavaScript (Node.js), 30 bytes

a=>eval(`[${a}]`).filter(eval)

Try it online!

Assume no zero input

JavaScript (Node.js), 39 bytes

a=>((a+'').match(/\d+/g)||[]).map(eval)

Try it online!

Assume no negative input

JavaScript (Node.js), 39 bytes

a=>((a+'').match(/\d+/g)||[]).map(eval)

Try it online!

Assume no negative input

JavaScript (Node.js), 30 bytes

a=>eval(`[${a}]`).filter(eval)

Try it online!

Assume no zero input

JavaScript (Node.js), 39 bytes

a=>((a+'').match(/\d+/g)||[]).map(eval)

Try it online!

Assume no negative input

Source Link
l4m2
  • 32.5k
  • 2
  • 26
  • 116

JavaScript (Node.js), 39 bytes

a=>((a+'').match(/\d+/g)||[]).map(eval)

Try it online!

Assume no negative input