Page 1 Copyright - Prolearninghub - All Rights Reserved. Page 2 Types and Libraries JavaScript Types: In every programming language, there are various types used to assign a value to the variable but, the type name is different in different programming languages. The JavaScript types are judged dynamically: The JavaScript language is a dynamic language i.e, the javascript types do not need to be declared with the name of the variable, the javascript types are declared dynamically. For example: var length = 16; // Number var lastName = "Johnson"; // String var x = {firstName:"John", lastName:"Doe"}; // Object The type concept is very important in every programming language and to operate a particular variable we need to know the type of the variable. For example: var x = 16 + "Hello"; In the above example, the variable x contains both integer as well as string so in this case JavaScript consider 16 as string and add 16 to Hello. The javascript compilers are so smart that they don’t get confuse so fast, so, instead of giving error JavaScript concats integer to string. Copyright - Prolearninghub - All Rights Reserved. Page 3 Types in JavaScript: In JavaScript according to ECMAScript standards, there are six types: Six data types that are primitives: Boolean Null Undefined Number String Symbol (new in ECMAScript 6) JavaScript Strings: A JavaScript string is a combination of characters for example “Hello World”. The JavaScript strings are written inside “” double quotes and single quote can also be used in place of double quotes. For example: var carName = "Volvo XC60"; // Using double quotes var carName = 'Volvo XC60'; // Using single quotes A single quote can be used in a JavaScript string like this: var answer = "It's alright"; // Single quote inside double quotes Similarly, the double quote can be used inside single quote. Like this: var answer = 'He is called "Johnny" '; // Double quotes inside single quotes Copyright - Prolearninghub - All Rights Reserved. Page 4 In the above statement, the double quoted string(“Jonny”) is defined inside single quoted string, the JavaScript understands the opening and closing of quotes and does not give errors. JavaScript Numbers The JavaScript numbers can be written with decimals and without decimals. In various programming languages decimal values use float type. Rest is integer types. For example: var x1 = 34.00; // Written with decimals var x2 = 34; // Written without decimals For big JavaScript numbers: var y = 123e5; // 12300000 var z = 123e-5; // 0.00123 JavaScript Booleans: There are only two values that can be implemented with JavaScript Boolean that are true or false. The Boolean are used with conditional statements. For example: var x = true; var y = false; JavaScript Undefined Copyright - Prolearninghub - All Rights Reserved. Page 5 In JavaScript, when a variable is declared without assigning any value then the variable will automatically assign with the undefined value. For example: var person; // Value is undefined, type is undefined When a JavaScript variable is assigned with undefined value then the javascript variable will act as an empty variable. person = undefined; // Value is undefined, type is undefined JavaScript Null In various programming languages, null value act in a similar way in JavaScript. The null value represents “nothing” or doesn’t exist. If a variable is assigned a null value, the variable has “nothing” but the data type will be an object. For example: var person = null; // Value is null, but type is still an object Difference between Undefined and Null: The main difference between undefined and null is that if a variable is assigned undefined then its type will be undefined but if the variable is defined null then its type will be an object. typeof undefined //type is undefined Copyright - Prolearninghub - All Rights Reserved. Page 6 typeof null //type is object null === undefined // false(not equal) null == undefined // true(equal) JavaScript Libraries: The JavaScript libraries are the generally implemented code which is included in your application for different tasks, like DOM manipulation and HTTP requests. For example, jQuery is a pre- implemented JavaScript library which makes easier to implement task in your JavaScript application. To include a lodash and d3 JavaScript libraries we need install these libraries and add to the project. Check below code: <script src="lodash.js"></script> <script src="d3.js"></script> Below is the division of JavaScript library on the basis of the task need to implement in your JavaScript application: For DOM (manipulation) oriented Dojo Toolkit jQuery Midori MooTools Prototype JavaScript Framework React YUI Library For Graphical/visualization (canvas or SVG related) AnyChart D3.js Copyright - Prolearninghub - All Rights Reserved. Page 7 Highcharts EaselJS, part of CreateJS JavaScript InfoVis Toolkit p5.js Pixi.js Plotly Processing.js Raphaël SWFObject Three.js Velocity.js WhitestormJS For GUI-related (widget) AngularJS (framework) Bootstrap DHTMLX Dojo Widgets Ext JS of Sencha ZURB Foundation Google's Polymer paper elements jQuery UI jQWidgets Ignite UI of Infragistics Kendo UI of Telerik Wijmo 5 of GrapeCity OpenUI5 of SAP qooxdoo SmartClient Webix WinJS For No longer actively developed Ample SDK Copyright - Prolearninghub - All Rights Reserved. Page 8 Glow Lively Kernel Script.aculo.us YUI Library For Pure JavaScript/Ajax Google Closure Library Joose JsPHP Microsoft's Ajax library MochiKit PDF.js Rico Socket.IO Spry framework Underscore.js For Template systems Cascade Framework jQuery Mobile Mustache Jinja-JS Twig.js For Unit testing Jasmine Mocha QUnit Tape Unit.js For Web-application related (MVC, MVVM) AngularJS Backbone.js Cappuccino Chaplin.js Echo Ember.js Copyright - Prolearninghub - All Rights Reserved. Page 9 Enyo Ext JS Google Web Toolkit JavaScriptMVC Knockout Meteor Mojito MooTools Node.js Prototype JavaScript Framework React.js Rialto Toolkit SproutCore Vue.js Wakanda Framework Copyright - Prolearninghub - All Rights Reserved. Page 10 Copyright - Prolearninghub - All Rights Reserved. Page 11 Copyright - Prolearninghub - All Rights Reserved. .
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages11 Page
-
File Size-