Skip to main content

Posts

Javascript ECMAScript6 New Feature

Extended Parameter Handling Another nice set of features introduced in ES6 is the extended parameter handling. These provide a very nice set of idioms that bring us very close to languages like C# or Java. Default parameter values and optional parameters Default parameters allow your functions to have optional arguments without needing to check arguments.length or check for undefined. Let’s take a look at what that might look like: let greet = (msg = 'hello', name = 'world') => {   console.log(msg,name); } greet(); greet('hey'); Looking at the preceding code, you can see that we are using the new fat arrow (=>) syntax as well as the new let keyword. Neither of those are necessary for this example, but I added it to give you more exposure to the new syntax. Running the preceding code produces the following result: hello world hey world  Rest parameter Handling a function with a variable number of arguments is always t
Recent posts

Javascript ECMAScript6 New Feature

Arrow functions  I think that an  arrow functions  are one of the best features of  ECMAScript 6 , excluding  class -es and  OOP  programming at all. It has really very helpful and  useful syntax  for scripting language. So let’s check it out: Syntax     //Function with no parameters:     () => { statements } ]     //Function with single parameter:     singleParam => { statements }     //Function with one and more parameter:     (param1, param2, …, paramN) => { statements }         //Function with simple return statement:     n => n * 2 How did it look in ECMASript 5?     //Function with no parameters:     function () { statements }     //Function with single parameter:     function ( singleParam ) { return statements }     //Function with one and more parameter:     function (param1, param2, …, paramN) { return statements }         //Function with simple return statement:     function (n

Javascript ECMAScript6 New Feature

ECMAScript 6 Const Const In  ECMAScript 6  we have  const  variable arrived. Does it work the same as C++  const ? Not exactly. I would even say,  “not at all” . When you declare something with  const  in  ECMAScript 6 , it means that the  identifier can’t be reassigned.   What does it mean?   It means that you cannot declare that variable more than once. Because its  binding is immutable .  You have guaranty that  no rebinding will happen  to it.  You will  not  be able to change its  type . If your  const  variable is a simple value, like  string ,  number ,  boolean  etc. you also  wouldn’t be able to change its value . So let’s look how does it work: Declaration Very simple. Just use  const  instead of  var  :     const brandColor = 'turquoise' ;   The value of a constant doesn’t have to to be known at compile time, but you must assign it a value exactly once. Const  and scopes Redeclaring: Constants can’t be redeclare

Angular 2 - Architecture

Angular is designed to be modular, an Angular 2 app comprises of several  components , which are connected via routing or selectors, these components may have templates attached to it which may display component prope rties and attach events to interact with the properties Modules Angular App comprises of several  Modules , a module typically exports something of a purpose. A module is a set of similar utilities that perform a similar task. Typically a module may export a class which we may be imported in other modules. Angular 2 itself ships in large modules, some of them are ‘ angular/core ‘, ‘ angular/router ‘ and there are more. Components Components are the  basic building blocks  of an Angular 2 app. A component is typically a type-script class which has a template attached, it usually assembles a screen, ui-element or a route in the application. A component may have child components.  A component has a metadata/ decorator associated which describes the component. M

Angular 4

Building Blocks of Angular 4 There are 5 section cover in this blog .. module  component  template metadata data-binding Module module is a class with ng-module metadata, every angular app has at least one root module encapsulation of different similar functionalities  how to declare : @ngmodule({ //decorator     declareation :[AppComponent,TaskComponent],         //declare Component     imports :[BrowserModule,FormsModule,HttpModule], //import Module     providers:[], bootstrap:[AppComponent] //providing services to all modules component }) Component Angular 4 components are simply classes that are designated as a component with the help of a component decorator.  Every component has a defined template which can communicate with the code defined in the component class. So, let's take a close look at how components are structured. Metadata metadata describes how to process the class ,decorator is used to att

What's New in Visual Studio 2017 RC

What's  New in Visual Studio 2017 RC We have many new as well as improved features and experiences in Visual Studio 2017  to make you more productive at things you do every day IntelliSense  IntelliSense comes enhanced with added filtering that makes it much easier to use . Filtering makes long lists much more manageable. With features like Camel Case search you only need to type in the 2 letters in capitals for IntelliSense to appropriately filter results for you that match 2 different words with those letters capitalized. IntelliSense is also smarter now; it will select the best matching result from the list instead of simply picking the top result. Navigation Navigation . Navigate To is much more powerful with better filtering and preview.  We have also fixed Find All Reference by adding color, grouping, and a peek preview in the Find All Ref window. Live editing One of the most useful features is live code analys