Answers for "readline sync question"

0

readline sync question

var readlineSync = require('readline-sync'),  animals = ['Lion', 'Elephant', 'Crocodile', 'Giraffe', 'Hippo'],  index = readlineSync.keyInSelect(animals, 'Which animal?');console.log('Ok, ' + animals[index] + ' goes to your room.');
Posted by: Guest on December-28-2020
0

readline sync question

[1] Lion[2] Elephant[3] Crocodile[4] Giraffe[5] Hippo[0] CANCEL Which animal? [1...5 / 0]: 2Ok, Elephant goes to your room.
Posted by: Guest on December-28-2020

Browse Popular Code Answers by Language