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
maximecb edited this page Sep 25, 2014
·
4 revisions
Higgs has a library to to allow you to pretty-print objects/data to stdout and read input from stdin.
Importing:
// To us use the console functions you must import the console module:varconsole=require('lib/console');
Functions:
// To pretty-printconsole.log("foo");console.log({foo: "bar"});// If you pass multiple arguments, they are printed on the same line separated by tabsconsole.log(1,2,3);// Use console.prompt to prompt users for input.// console.prompt(takes an optional "string" or value as a prompt message)console.prompt("Enter you name:");// Examples to assign the input to a variable.varusername=console.prompt("Choose a username:");// Include a prompt with eval into your programs as a testing / development toolvartestvalue1=eval(console.prompt("test expression 1:"));// Higgs REPL // test expression 1:// 1+2// h> testvalue1;// 3