Jquery’s $ seems like magic? actually it’s a one liner.

$ = (queryString) => document.querySelector(queryString);

you can see it in practise here :

https://github.com/Abdur-rahmaanJ/hadith-of-the-day/blob/master/extension/hadith/script.js

=> is called an arrow and that type of statement is called an arrow function !

Advertisements