Cloud Pak for Integration

Cloud Pak for Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only

Node.js Blog #01 - JavaScript Language History

By Glen Brumbaugh posted Sat May 19, 2018 02:41 PM

  


JavaScript Language Development

JavaScriptJavaScript, originally named LiveScript, was developed at Netscape in 1995. The language's purpose was to allow web pages to exhibit dynamic behavior. LiveScript had no relationship to, or shared history with, the Java programming language. The language, however, was designed to be "consistent" in style with Java. LiveScript was almost immediately renamed to JavaScript for marketing reasons. JavaScript is frequently abbreviated as "JS". Along with HTML and CSS, JS is one of the three core display technologies of the World Wide Web.

Almost immediately after its initial release, JavaScript language standardization efforts began. These standardization efforts were thwarted by the lack of cooperation between the major Web Browser vendors. Netscape, Microsoft, and others were engaged in a monumental battle for strategic dominance in the browser market. These vendors did not want an Open Standard, they wanted control of the marketplace. These was a time when many web pages only displayed properly in certain browsers due to the lack of standardization.

The JS language received a significant boost in 2005 with the development of Ajax. Ajax was based upon JavaScript and had a major impact on web performance. This resulted in an explosion of JS frameworks and libraries to support Ajax and other programming initiatives. The newly developed libraries included, amongst others, JQuery and the Dojo Toolkit. These developments, in turn, spurred the increased usage of JS.

The usage of JS in Web Browser environments came to be called "Client side". The increased usage of Client side JS stimulated renewed interest in developing other runtime environments. In 2009, the CommonJS project was launched to standardize these "Server side" runtimes. Also in 2009, Ryan Dahl developed Node.js as a Server side runtime. In 2010, the "npm" (the letters are NOT an acronym) package manager for Node.js was developed independently. By 2015, the Node.js Foundation was put in place to provide a common Open Source community. Currently (April 2018), there are currently over 650,000 JS packages available through npm.

JavaScript has come to be seen as one of the "foundational" languages for modern computing. All modern Web browsers support JavaScript natively, without the need for a plug-in. The use of JS to create dynamic behavior is also termed Dynamic HTML, or DHTML. Its dominance in Client side computing is complete. 95% of 10 million most popular web pages use JS. JS is available as a Server side runtime from all of the major Cloud Vendors (IBM, AWS, Microsoft, etc.) It has been extended by multiple frameworks, including: React (Client-side), Node.js (Server-side), Node-Red, and LoopBack.


JavaScript Language Overview

JavaScript is an interpreted language. It has no native Input/Output (I/O) capability. These I/O functions are left to the runtime environment to provide.

JavaScript is an Object Oriented language. All variables must be declared. All variables are objects. If more than one value is assigned to a variable, the object will contain name value pairs. A brief overview of the language follows below.

Some of the rules for the JavaScript language are:

  •   JavaScript ignores whitespace. 
  •   JS commands are terminated by a semi-colon (";"). 
  •   Commands can be combined into blocks, delimited by braces ("{", "}"). 
  •   Strings are surrounded by single (') or double (") quotes. 
  •   Variable names (identifiers) are case sensitive. 
  •   Comments on a single line begin with "//". 
  •   Comment blocks begin with "/*" and end with "*/". 
  •   Variables defined outside of a Function are global in scope. 
  •   Variables defined inside of a Function are only visible in the function.

 

Some of the JavaScript commands (keywords) are:

  break   Terminate a switch or a loop.
  catch   Defines error handling for a block.
  continue   Terminate current iteration of a loop.
  do   Execute a block of commands.
  else   Defines a block when "if" is false.
  for   Terminate a switch or a loop.
  function   Defines a function.
  if   Defines a condition to execute a block.
  new   Creates a new object instance (e.g. var x = new className();).
  return   Exits a function.
  switch   Defines a set of conditional blocks.
  try   Defines a block needing error handling.
  var   Define a variable.
  while   Defines a condition to repeat a block.

 

Some of the JavaScript assignment & arithmetic operators are:

  =   Assignment (Assign value on the right to the variable on the left).
  +   Addition (Numeric). Concatenation (String).
  -   Subtraction.
  *   Multiplication.
  /   Division.
  %   Modulus (Remainder).
  ++   Increment (Add 1).
  --   Decrement (Subtract 1).

 

Some of the JavaScript comparison & logical operators are:

  ==   Equality (value).
  ===   Equality (value & type).
  !=   Inequality (value).
  !==   Inequality (value or type).
  >   Greater than.
  <   Less than.
  >=   Greater than or equal to.
  <=   Less than or equal to.
  &&   Logical "And".
  ||   Logical "Or".
  !   Logical Negation ("Not").

 

Some of the ways objects are used include:

  •   Object "methods" are implemented as functions within an object. 
  •   The value the Object "method" returns is referenced as if it were a variable.

Angular Client-side Framework

Angular.pngAngular is an Open Source web application framework maintained by Google with the support of a broader community of developers. The original release of Angular (version 1) is referred to either as AngularJS or Angular.js.  The current (version 2) release of Angular is referred to as simply Angular.  The Angular framework can best be understood as an "extension" to HTML.  The Angular framework implements a Model-View-Controller (MVC) paradigm to simplify the management of individual web pages.  This framework leverages custom tags built into the HTML to be rendered.  These tags "bind" elements of the HTML page to JavaScript objects.  These objects can then be manipulated through JavaScript code before being converted into the final HTML page to be rendered by the browser.  

Angular is added to a HTML page through the "


#ChampionsCorner
0 comments
35 views

Permalink