====== JavaScript ====== ===== Package Management ===== NPM is used for package management. curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1 ./configure This will install ''node'' and ''npm'' in ''/usr/local/bin''. ===== IDE ===== Netbeans 8.0 has good JavaScript and even AngularJS support. See [[https://blogs.oracle.com/geertjan/entry/integrated_angularjs_development|Integrated AngularJS Development]] ==== Project Setup ==== File ⇒ New Project ⇒ HTML5 sets up a JavaScript project. On Step 3 //Site Template// ''AngularJS Seed'' can be selected. Additional JavaScript libraries can be selected on step 4. This will not completely setup the new project. npm install needs to be executed from the command line in the project directory. ===== Libraries ===== * [[https://github.com/Foxandxss/angular-toastr | AngularJS Toaster Messages]] * [[https://github.com/arunisrael/angularjs-geolocation | AngularJS Browser Geo Location Service]] ===== Tips ===== ==== Console Output ==== Output can be written by using the console. console.log("My information"); ==== Lifetime of Variables ==== The lifetime of a JavaScript variable starts when it is declared. Local variables are deleted when the function is completed. Global variables are deleted when you close the page. ==== Number Properties ===== * MAX_VALUE * MIN_VALUE * NEGATIVE_INFINITY * POSITIVE_INFINITY * NaN * prototype * constructor Number properties belongs to JavaScript's number object wrapper called Number. These properties can only be accessed as Number.MAX_VALUE. Using num.MAX_VALUE, where num is a variable, expression, or value, will return undefined. ===== Links ===== * [[http://www.w3schools.com/js|W3C JavaScript Tutorial]] * [[http://stijndewitt.wordpress.com/2014/01/26/enums-in-javascript/ | Enums in JavaScript]] {{tag>javascript devel}}