What environment is this?

<PLEASE USE THIS TEMPLATE TO HELP YOU CREATE A GREAT POST!>

<Below this line, add a link to the EXACT exercise that you are stuck at.>

<Below this line, in what way does your code behave incorrectly? Include ALL error messages.>
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 theparseInt 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…’);

print(‘result’);

<do not remove the three backticks above>

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…

https://www.google.ca/search?q=readline()%20js

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