In this document.
What I have done is I have created a new variable called it as name builder, and then again a function
to it.
So first name is equals to John and comma with the last name is equal to Doe.
Now, usually in Es5, we never used to do this.
We just used to give the parameters here and then we used to call that in the name middle function.
But in the ES6 we can actually add the is equal to sign and then we can assign a default value for that.
The first name.
If your browser is not compatible with the ES6, then this is not going to run.
For example, I'm using Chrome, so currently this function is available for the Chrome browser.
If I go to the browser and click on refresh, I can see my John Doe works completely fine, but most
of the time a lot of people visit your website through their mobile phone or most of the web applications
which are built with the NodeJS or any kind of framework use Babel.
So it is a good idea for us to use Babel or include Babel in our project.
So let's see how we can do that.
I'm going to go to Google and look for Babel.
JS.
Now, once the Babel jazz site is loaded, you can go to the setup option here and then you can choose
in the browser.
So you can see that we have a list of options which you can use.
This is the what we are going to use.
Just copy this one.
Come back to your code and then put it in the head.
Now we need to add our type as babble.
So just copy this one.
Paste it.
Now I can get back to your browser with your project file and click on refresh.
See you get this message.
You are using the In-browser Babel transformer.
Be sure to pre-compile your scripts for production and then we have johndoe outputted here.