Learning Elixir is not just about learning its syntax, it gives a whole new way of thinking.
I expect most of you are coming from different backgrounds and learning Elixir as your second or third programming language. If you are learning it as your first programming language believe me ‘you are the chosen one! 😄’. I am a little biased here, and I think I will always be, for me Elixir was love at first sight.
It’s really interesting how a language which runs on the Erlang VM is an extremely fun and easy-to-use programming language. Developers generally avoid learning…
Elixir is great for writing highly parallel, reliable applications
In the words of José Valim Creator of Elixir.
Elixir is a pragmatic approach to functional programming. It values its functional foundations and it focuses on developer productivity. Concurrency is the backbone of Elixir software. As garbage collection once freed developers from the shackles of memory management, Elixir is here to free you from antiquated concurrency mechanisms and bring you joy when writing concurrent code.
spread operator OR as a
Both rest parameter and spread operator are kinda opposite to each other.
Rest parameter is used to collect elements into an array, while, Spread operator is used to spread the items of an array into single elements.
Let’s not waste much time in definitions, let’s code and see how these actually work.
Let’s play with these a little.
I am going to be very specific here, we are not going to discuss some bookish definitions here like what is Array or DOM, it’s better to refer mdn or Wikipedia for it. Better let’s code and understand.
Writing about DOM is kind of little cliche now. So, I decided to go with an interesting part, with which beginners struggle a bit when they start learning DOM. Personally, I found it tough to understand the difference between these three.
Among others, the following four data structures are new in ECMAScript 6:
In this blog, we gonna learn about Map and Set.
Objects and Arrays are already there, then why do we need more data structures like Map and Set.
Working on real projects handling big and complicated data, somewhere Objects and Arrays are not enough. That’s why Map and Set also exist.
To understand in an easy manner, we can say Map is like an Object and Set is more like an Array.
So, What’s the difference?
Map is a collection of keyed data…
“Destructuring” does not mean “destructive”.
Still remember, the first time when I saw a code something like this..
let [color, day] = ['red', 'sunday']
I was like how we are declaring an array name itself as an array with square brackets that too by using ‘let’. I know its kinda beginner’s way of approaching it 😅😛.
After understanding how it works, I thought it's just syntax sugar, yeah it's really a syntax sugar but really help us easier to express and saves our few lines of code.
Let’s see how it works.
In arrays, if we have to store its…
Have a look at what we gonna make.
Yes, we are going to clone this and I m going to teach step by step without skipping any.
I will advise you to get the starter pack in which I have already done the basic HTML and CSS, so that we can directly learn how to make it functional.
So, without wasting any time. Let’s start.
We are going to apply the concept of classes. We are going to take a class with the…
let str = 'Hello World'; //I m going to use this string as an example to explain all methods.
str.length ; //it returns the length of string
2. charAt( ) ;
//it takes index as parameter and returns the character at that index.
3. charCodeAt( ) ;
//takes index as parameter and returns an integer between 0 and 65535 representing the UTF-16 code
4. concat( );
let str2 = “ this is js” ;
“Hello World this is js”
//it takes other string as a parameter and returns a new string after combining them.
Let’s learn it together