- Oct 23, 2012
- 12,527
Microsoft released this week version 2.0 of TypeScript, the alternative version of JavaScript that its developers created to simplify writing and reading JS code.
When it launched, there was already a JavaScript superset on the market called CoffeeScript, that did the same thing by allowing developers to use a simpler syntax to write their JS code and then compile it to strict JavaScript syntax.
Microsoft's enormous resources and a horde of top-shelf programmers helped TypeScript replace CoffeeScript as the top JavaScript superset on the market, so much so that Google's own developers decided to use it to write version 2 of their popular AngularJS JavaScript framework.
The biggest change that Microsoft added in TypeScript 2.0 is how the language now handles "null" and "undefined" errors, via their own type (category).
"In TypeScript 2.0, null and undefined have their own types which allows developers to explicitly express when null/undefined values are acceptable," Microsoft explains. "Now, when something can be either a number or null, you can describe it with the union type number | null (which reads as 'number or null')."
Noteworthy article.
When it launched, there was already a JavaScript superset on the market called CoffeeScript, that did the same thing by allowing developers to use a simpler syntax to write their JS code and then compile it to strict JavaScript syntax.
Microsoft's enormous resources and a horde of top-shelf programmers helped TypeScript replace CoffeeScript as the top JavaScript superset on the market, so much so that Google's own developers decided to use it to write version 2 of their popular AngularJS JavaScript framework.
The biggest change that Microsoft added in TypeScript 2.0 is how the language now handles "null" and "undefined" errors, via their own type (category).
"In TypeScript 2.0, null and undefined have their own types which allows developers to explicitly express when null/undefined values are acceptable," Microsoft explains. "Now, when something can be either a number or null, you can describe it with the union type number | null (which reads as 'number or null')."
What this means is that developers won't accidentally allow their variables to assume the "null" or "undefined" values, giving them more control over the errors that happen in their code. Good guy, Microsoft!
In other JavaScript news...
There's a group of people on Facebook called "Occupy HTML5" that are still refusing to accept the fact that JavaScript and HTML5 will replace Flash.
Node.js v7 will be out next week, powered by V8 5.4, and will support 98 percent of the ES6 language features , which is up from 56 percent in Node.js v5.
Not necessarily "JavaScript news," but Drupal.org, the home of the Drupal CMS just got a facelift. Go check it out!
Also, don't forget to read our article on HTML 5.1, the new HTML specification set to be released this fall.
Noteworthy article.