I saw this for lots of other languages but not JavaScript.
I\'m trying to do problems like: this (codechef.com) and of course the programs need to be able to read
It's not in the ECMAScript (standardized version of JavaScript) standard library. However, some implementations of JavaScript do include it. For example, CommonJS, which is used by several out-of-the-browser JavaScript environments, has a system.stdin property. Rhino can use Java's standard input classes.
If you're just trying to practice programming, you can use a textarea as a substitute for standard input.