10 JavaScript Things You Need To Know

Saiful Rafsun
5 min readNov 3, 2020

Today, I’m going to discuss 10 random things to boost your JavaScript knowledge so that you feel a little more of a JavaScript developer. As a react developer, I’m trying to deep dive into JavaScript and know more about how it works as every day goes. If you’re a newbie to JavaScript and want to know some basic things before joining a team, this article will help you. I hope so.

1. Primitive Values

There are six types of data that are primitive. Strings, numbers, bigint, boolean, undefined, and symbols are the six primitive data types. These data types can contain only a single thing in memory.

2. V8 Engine

Basically, the V8 engine’s job is to run JavaScript in chrome. V8 is the JavaScript runtime for chrome. JavaScript is the verb for websites. You are able to click on a website and order because of JavaScript. JavaScript is synchronous. That means it runs one block of a code at a time. But, after you click on the “order” button, you don’t actually ever get stuck on that button, you move on to order something else or maybe you proceed to checkout. Meanwhile, your order is on the way and you can do more with the website. So, if you’re doing other actions on the website at the same time, what about that when I said JavaScript is synchronous? This is where V8 comes. With the help of call stack, event loop, web API and many other things, you’re able to observe asynchronous behavior in JavaScript on websites. You don’t get stuck on that order button. You can learn more here

https://www.youtube.com/watch?v=8aGhZQkoFbQ&fbclid=IwAR3Tw62M-Eq3NBoPhPcr-00Zjswuhfb-HVJ9xT2Ev4lmW-NszsFYHmXpNHE

3. Error Handling

Errors can be tough to handle sometimes and to handle errors in code some techniques might be handy. You’ve to first identify where the problems lie in your program. Usually, a program stops working when errors are found. Basically, if you want to avoid crashing your program and want to do something more reasonable you should use the try..catch syntax so that instead of a dead program your program gives you hint about what to do. Basically, how it works is the first ‘try’ block will run and if it runs successfully the ‘catch’ block won’t run.

4. Coding Style

Everyone can have different kinds of coding practices. Whether you have your own style or not, you should follow some basic rules. Follow the MDN article to know more about line-height, indentation, semicolons, and where you should put curly braces. https://javascript.info/coding-style?fbclid=IwAR0luPQnv8EIXQzICi92RzkiyKhP0pxIGsdOVyY4T7c95aMfQdrUfArwPbg

6. Comments

Well, I know you can write a comment as you wish in your code. But, it has to be readable so that when your colleagues or boss watches a block of comments he understand what something in your code is used for. You should avoid how the code works or what it does.

Photo by Pankaj Patel on Unsplash

7. Caching

What caching does is actually store some subsets of data that is frequently used by web applications to efficiently reuse it and make web application more user friendly. Caching can be done in more than one way. But you have to balance caching on your website to make it efficient and more user-friendly.
Know more about balancing caching here: https://nordicapis.com/balancing-client-and-server-caching-in-web-application-development/?fbclid=IwAR1GzWN_5nY7MZkfrEj0bgonAY3XVRqopG_tAwB640QgHQRNDqSx7yLZAPM

8. Cross browser Testing

Cross browser testing is required to make sure whether the user is using chrome or firefox or any other browser they get the same experience using your website. Not every browser that you use has the same capability to read your code in the same way. Some are older than others and there is a portion of users that are using those older browsers. So the purpose of cross browser testing is to check whether the application runs smoothly as you want it in every different browser. Also, there are different kinds of devices used such as tablets, TVs, smartphones, etc. and developers have to make sure it is responsive to those devices too. So, testing your web application in different browsers and devices before production might actually save you time.

Photo by Thomas William on Unsplash

9. APIs

Application Programming Interface or API is a messenger that takes a request and tells the system what to do. Some data on websites might be loading from databases and you might not be able to even access the data. It’s actually a way to communicate through systems and share data as per need. API enables websites to connect and load data dynamically. One of the popular API to use for testing your website is https://jsonplaceholder.typicode.com/

10. ES6

There is nothing static about being a web developer. You’re gonna have to adapt to changes as the industry changes over the years. Every year as frameworks, libraries, browsers, and workflow updates you have to update yourself too. For javascript, ECMAScript brings changes every year to make the language more efficient, optimized, organized, and more interesting to code. There have been changes in ECMAScript since version 1 and it will continue to do so. ES5 and ES6 brought some really powerful changes and made coding in JavaScript more interesting. Most codebases now use these features. It introduced us to let and const which is obviously different from var. We developed a new idea about hoisting and came to know about template string which can be very useful. Know more about ES6 at https://www.freecodecamp.org/news/write-less-do-more-with-javascript-es6-5fd4a8e50ee2/

That’s it for today folks. Hope this topic was helpful in your web developer career. Thank you for the read.Bye👋

--

--

Saiful Rafsun
0 Followers

JavaScript || ReactJS || Web Developer