Can someone please confirm that gets() is not part of the JavaScript Standard Library?

Viewed 38

I recently worked my way through a developer pre-screen via an online candidate testing platform. I've had bad experiences with these platforms in the past - poorly written/structured code, unclear instructions and code comments - but I'd yet to encounter a JavaScript question that (possibly) included C syntax ... until today.

The question was straightforward enough: create a function that took in a single parameter (milliseconds), converted that parameter to a new Date object and then returned only that Date's day-of-the-month.

Here was the boilerplate code I was asked to start with:

function convertMilliseconds(milliseconds) {
   var result = -404;
   return result;
}

var milliseconds = Number(gets());

console.log(convertMilliseconds(milliseconds));

Edit: To clarify, gets() was not explicitly referenced in the question's prompt, nor were there are any code comments in the web-based code editor asking me to implement it as a custom function. Here is a screen cap to illustrate:

enter image description here

Can someone please confirm for me that gets() is not part of the JavaScript Standard Library?

I've consulted the MDN docs and did not find anything in the entry for Number to indicate this was valid code. I did, however, find references to C library function called gets().

I try and make a point of using these pre-screens to fill any conspicuous gaps in my JavaScript knowledge. I'm pretty sure this is just a glaring error on the testing platform's part; I just want to be doubly sure I'm right before writing this off and moving onto other things.

0 Answers
Related