To evaluate a single line of code, make sure the cursor is positioned in the appropriate line in the console window and press either Enter on the numeric keypad or Ctrl+Enter on the regular keyboard.
After evaluating each JavaScript script, the console window prints out undefined, which is the return value of the statement. Notice that the result of a statement is not the same as the value of an expression within the statement. The return value undefined does not mean that the value of script is undefined; it means that the return value of the JavaScript statement is undefined.
See also 

Executing scripts in the JavaScript Console