JavaScript

I didn’t realize how powerful and wonderful Javascript really is until I sat down for several evenings trying to learn some of it.

It is one of the three big ones, extensively in use all over the web

HTML, CSS and JavaScript

Javascript has nothing to do with Java, they are totally different.

Javascript is an object oriented language, and learning it you quickly realize an importance of routes, calls, returns, dependencies, objects, methods, classes, and logic that quickly comes into play, which is typical. The latest version is ES6, or ECMA Script6, a version where a consortium of people agreed upon major changes in the programming language.

Most modern browsers all support this.

Examples of “new” features with this is the use of variable name “let”, arrow for abbreviation “function” and the use of “classes”.

It is primarily a front-end language, which is running in the browser

What I did to get started was the following:

  • Youtube, find your favourite teacher for free, there are many
  • Project, have a loose plan of what you are trying to accomplish
  • Tools, find suitable tools and create an anvironment that is easy to work with, and add useful extensions
  • Additional frameworks and standards
  • Chase the solutions ,- find an answer to issues that arise, from this you learn alot about the programming language. But don’t stagnate and loose your inspiration, go on!

Tools

I am using Atom as my main editor

I also use MS Visual Studio Code

I also use Brackets especially for coding P5.js

All of these text editors have nice extensions like FTP-uploaders, Beautifyers, Console loggers auto-type features, linting, debugging, intellisense etc

Project

I had an idea of wanting to show Telldus API data on my own webpage

Step one was then to see what’s available..

I managed to pull the JSON data from the Telldus API and save it locally based on Node described underneath. Using Javascript to parse the JSON data I am extracting my selected sensordata and displaying it on my page with P5.js Javascript and HTML

Additional frameworks and standards

I started using Node.js which makes it possible to run Javascript in the back-end, on the server. This is making severside API calls and Oauth, saving to files etc possible. Node has got it’s own package manager (npm) which is a fantastic tool for adding functions, community driven. -No need to re-invent the wheel if there is a pre-buildt function for it.

As an example for my project I settled on Telldus-Live-Promise which is an npm package that takes care of the API call to Telldus. By the way, “Promise” is a Javascript object that allows you to write asynchronous code in a synchronous way. A promise that data may be available to process and the logical functions with this.

The npm package “express” can host a Node driven site wich manages Node Routes, request and respone

P5.js based on Processing, is using Javascript and is great for publishing graphical content

More articles