What environment is this?


Hi everyone, I'm curious as to what environment the code below belongs to. I'm new to coding and I practiced using javascript on Webstorm v10. I think it's safe to assume print() is the same as console.log. However what exactly is readline() since it doesn't look like a regular JS function. Is this the equivalent of the prompt or readlineSync.question function that takes user input? For example in line 1, is var n set to collect user input while being converted from string to integer (hence the**parseInt** function)? Any feedback is much appreciated.

var n = parseInt(readline()); // the number of minutes to analyse
var min = readline(); // the n minutes expressed as integers ranging from -273 to 5526

// Write an action using print()
// To debug: printErr('Debug messages...');



Dead giveaway for JavaScript. Since it has a print function, it would have to be ES6.

The readline() function looks like it could be part of a library. Which one is hard to nail down...



This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.