DEV Community

Cover image for Explore Javascript fundamental concept!
Abu Naser Dipu
Abu Naser Dipu

Posted on • Updated on

Explore Javascript fundamental concept!

1. Javascript error handling
A programmer's error handling must be known. Various types of error handling have in javascript one of them "try...catch".When code has no errors, it working process then code try part working and catch part stop its work and show output. But when the code has an error, try part stop working and catch part work and show an error.

2. Coding Style
Coding style makes code more readable and makes code more effective. Knowing this styles a programmer and code easily. Some coding styles principal is Curly Braces, Line Length, Semicolons, Nesting Levels. The easiest way to maintain code perfect style can use formatted extensions!

3. Coding Comments
Sometimes programmers need to do comments to understand the code working process. So coding comments rules must be known because unnecessary comments make code more complex. Some coding principles are (//) this sign used for line comment, (/.../) this sign used for multiline comment.

4. Catching & typeOf()
Space where data stored for a specific time when a user request it provides data to its user.
With typeOf() we can determine which is boolean, string, number, etc.

5. Cross-browser testing
Developer test his developed projects work in every browser and every user can use them smoothly. This is important for a developer to check his project work correctly in most browsers. Also, ensure it work in every type of smart device like PC,
Android, IOS, etc, and usable for disabled people.

6. Block bindings
var, let, const make an area from which they can be accessed from outside of this area they can not be accessible. var is a global variable it can be accessed from anywhere but let & const have restricted areas these areas are called block bindings.

7. Block bindings in loops
Block bindings are very useful when using loops. It is best practice to use let instead of var in loops because var makes it value global but let has a specific block.

8. Best practices for block bindings
ES6 development most developers use let instead of var and use const to limit the modification. Developer uses const as default
and uses let where the variable value should change.

9.Functions with default parameter values
In ES6 a new method added that programmer can add default parameter values for that time when users couldn't pass parameter or give it with an empty value.

10. Spread operator
ES6 explores a powerful thing that's called spread operator. Using it programmer can copy an array with only three dots(...). It saves programmer time & stress

Top comments (0)