3 ms·
Look at "hello world" in Javascript and Python. Then look at "ask user for their name and display "Hello user's name"" in Python and Javascript. https://wiki
by DanBC 12y ago
Look at "hello world" in Javascript and Python. Then look at "ask user for their name and display "Hello user's name"" in Python and Javascript.
https://wiki.python.org/moin/SimplePrograms https://wiki.python.org/moin/SimplePrograms
name = raw_input('What is your name?\n')
print 'Hi, %s.' % name
http://www.utexas.edu/learn/javascript/example1.html http://www.utexas.edu/learn/javascript/example1.html
var who = window.prompt("What is your name");
document.write("Hello " + who);
The complication in the Javascript example are the window.prompt and document.write parts which make Javascript harder for beginners to learn.
- CyberFonic 12y agoThanks for the examples, it clearly demonstrates that JS on its own can't even provide minimal I/O. That is by design, in the ECMA 262 standard, it specifies the need for additional objects to provide the I/O. The core language is for scripting the "extension objects".