You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've tested this on my Linux PC and this code passes there. Problem is with OS X 10.10 MacBook Air learnyounode verify
Error I'm getting:
✗ Error connecting to localhost:20952: connect ECONNREFUSED
Your submission results compared to the expected:
ACTUAL EXPECTED
────────────────────────────────────────────────────────────────────────────────
"2015-08-02 20:08" != ""
"" !=
────────────────────────────────────────────────────────────────────────────────
✗ Submission results did not match expected!
# FAIL
Your solution to TIME SERVER didn't pass. Try again!
with code:
var net = require('net');
function putZero ( x ) {
return ( ( x < 10 ) ? "0" : "") + x;
}
var server = net.createServer( function( socket ) {
var date = new Date();
var timedate = date.getFullYear() + "-" + putZero(date.getMonth()+1) + "-" + putZero(date.getDate());
timedate += " " + putZero(date.getHours()) + ":" + putZero(date.getMinutes());
socket.write( timedate + "\n" );
socket.end();
});
server.listen( process.argv[2] );
Of course, learnyounode run time.js prints right time. Also running with node time.js 20952 and telneting to it works OK on OS X.
The text was updated successfully, but these errors were encountered:
I've tested this on my Linux PC and this code passes there. Problem is with OS X 10.10 MacBook Air
learnyounode verify
Error I'm getting:
with code:
Of course,
learnyounode run time.js
prints right time. Also running withnode time.js 20952
and telneting to it works OK on OS X.The text was updated successfully, but these errors were encountered: