I will start with TechBhubaneswar is one of the best-organized conference. Disciplined volunteers, visionary core team members, and electrifying audiences. It was surely a gala gathering of more than 500 techie in beautiful city of Bhubaneswar. I am humbled that I was invited as speaker. I had proud moment representing Infragistics in esteem conference and teaching some JavaScript to 250 developers.
You can watch my talk here:
On 10 December 2017, I had an opportunity to give a talk in East India Largest Developer Conference, TechBhubnaeswar. I presented on “JavaScript Objects and Prototypes”.
About the conference
TechBhubaneswar is East India largest tech conference, which brings together minds that are excited about headways, expansions and possibilities in the field of Software Industry. The event is hosted by Mindfire solution to inspire young techie minds to imagine and pursue. This was their second edition, and in a single day conference comprise of 12 sessions in 3 tracks and 1 panel discussion.
It was one of the best-organized conference attended by me. Each volunteer and members were highly motivated to deliver best experience to both speakers and attendees. I admire vison of Mindfire solution to bring esteem speakers to this part of India and nurture great tech eco system. Congrats to them for their awesome work.
About my talk
My talk was just after respected Shivprasad Koirala. He gave a very informative talk on Design Patterns in C#. I was bit nervous that how audience would take my session on JavaScript Objects and Prototypes.
As JavaScript prototypes are always confused for all of us, so I had a tricky task ahead of me to simplify this topic to 250 audiences. I had to use white board in a conference to simplify prototypes and __proto__ to developers.
I divided my one-hour talk in four section and did four major demos to teach these topics. I logically divided talk in four parts as,
I have written extensively about these topics on Infragistics blog here feel free to refer them. It was one of the best audience, I have ever presented too.
At the end, I found happy faces and it was good. Positive energy of each single audience motivated me and I thank them for bottom of heart.
You can watch talk here:
Once again, I thank TechBhubaneswar team for this opportunity and I look forward for next year conference.
ECMAScript 6 introduced the class keyword to create classes in JavaScript. Now, you can just use the class attribute to create a class in JavaScript. Before ECMA 6, whenever you called a function using a new operator, the function returned a new object. Therefore, the function was acting as a class and known as a constructor. This way of calling a function to return an object is also known as the Constructor Invocation Pattern.
But In ECMAScript 6, a class can be created using the class keyword. Consider the code below:
In the above code snippet, you have created a class named Car using the ECMAScript 6 classkeyword. You can also create an object of the Car class as shown below:
The JavaScript class is a simplified syntax for the usual prototype based inheritance. It does not offer any new way of object creation or prototype inheritance and does not bring any new models of object orientation or inheritance in JavaScript. You could say that a class is a special function to create objects.
In this post, we will learn about function expressions and the function statement.
Consider the following code:
When you create a function as shown above, it is called a function declaration or statement. You can rewrite the code above to add a function in different ways, as shown below:
The function created above is called a function expression – in this case, an anonymous function expression. A named function expression can be created as below:
The name of the function expression can only be used inside a function body, which is helpful in recursion. A function expression can either be a:
Named function expression
Anonymous function expression
The third method of creating a function is by using the Arrow function, which was introduced in ECMAScript 6. You can learn more about Arrow functions here.
In JavaScript, the apply() and call() methods execute a function in the context (scope) of the first argument you pass to them. Let’s take a look at them in action to learn more. Say that you have an object person as shown below:
And in addition, you have a function message as shown below:
Now, you have a requirement to pass the person object as the value of this in the function. In addition to explicitly passing the value of this, you also need to pass the value for the age parameter.
You can pass the context (the value of this) explicitly using by either the call() or apply() methods. Consider the following code:
Using the call method, we are passing the object person as the value of this inside message function. You can achieve the same using the apply() method as shown in the listing below:
In JavaScript, the call() and apply() methods work in almost exactly the same way, but with a few key differences:
The first parameter of both call() and apply() is the value of this object.
In the call() method, the other arguments to function will be passed as separate comma separated values.
The call() method takes zero or more individual parameters.
In the apply() method, the second parameter is an array.
The apply() method takes an array of parameter.
You should use the call() method when the number of function parameters is fixed.
You should use the apply() method, when the number of function parameters is not fixed.