Let's try creating a simple program using basic development tools.
- Prerequisite: Javascript development environment setup
Creating the First Program in Javascript
console.log("hello world!")
$ mkdir first-program && cd $_
$ npm init -y
Wrote to /home/harry/Projects/codeandtips/code/javascript/first-program/package.json:
{
"name": "first-program",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC"
}
node.js
$ node first-program.js
hello world!
Web browser console
> alert("hello world!")
hello world!
< undefined
C C++ C# Clojure Crystal D Dart Erlang F# Go Haskell Java Julia Kotlin Lua Python Rust Scala Swift Typescript