10 things that boost you to be a Good JavaScript developer!!!
JavaScript Data types: The top four data types and most important data types in JavaScript is numbers, objects, strings, and functions.
- Numbers: First I discuss numbers, JavaScript has only one type of number. These numbers can be written with decimals or without decimals.
const s1 = 23.00 //written with decimals
const s2 = 23 // written without decimals
Some big numbers are also needed sometimes, then we can use exponential notation to use these numbers. Suppose,
const f1 = 123e5; //12300000
const f2 = 543e-5; // 0.00542
2. Objects: It’s the most important term for a JavaScript developer. Objects are everywhere in JavaScript. Objects are written with curly braces {}.
Example: const employee = {name: “Hasan”, salary: “50000”, age: “25”, address: “Cumilla”};
This is a simple example, here are four properties of objects: name, salary, age, address. And in the “ ”, these are the properties value and we use the object values.
3. Strings: Another hot topic for a developer. Strings have some methods and properties.
String Length: This length is a property of the string. It returns the length of a string. Suppose,
const character = “ABCDEFGHIJKLMNOPQRSTUVWXYZ”;
const solution = character.length;
indexOf(): This method returns the position of the first occurrence of a specified text in a string.
var str = “Please locate where ‘locate’ occurs!”;
var pos = str.indexOf(“locate”);
4. Functions: Function is a block of code designed to perform a specific task.
Syntax: A JavaScript function is defined with the function
keyword, followed by a name, followed by parentheses ().
Function names can contain letters, digits, underscores, and dollar signs (same rules as variables).
The parentheses may include parameter names separated by commas:
(parameter1, parameter2, …)
The code to be executed, by the function, is placed inside curly brackets: {}

5. Error Handling, try-catch: Errors while coding is a very embarrassing situation for a programmer. A developer writes thousands line of code but if he/she mistakenly write a wrong code the whole code or program will die instantly.
Syntex: The try…catch construct has two main blocks: first, try and then catch.

This function first executed try block code, if in try block there is no error then it automatically ignores the err block. If any error is found in the try block then the code is stopped immediately, and then go to the err block and the err block say us what error happened in the try block.
6. Coding Style: Coding style is very important for a developer. Suppose, someone is a very good developer but his coding style is not good, then he/she is not considering a good developer. Code must have in good indentation, one developer code is easily readable by another’s the developer. Then your code might be a good one.
7. Cross Browser Testing: I think the headline defines the works of it. Sometimes websites need to be on test on different browsers and different kinds of devices because of testing. Testing is a very important part of development. Cross-browser testing is a type of non-functional testing that lets you check whether your websites work as intended when accessed through a different browser, OS combinations, etc.
8. Block-Level Declarations: Block-level declarations are those that declare variables that are inaccessible outside of given block scope. Block scopes are created:
- Inside of a function
- Inside of a block (indicated by the
{
and}
characters)
Block scoping is how many C-based languages work, and the introduction of block-level declarations in ECMAScript 6 is intended to bring that same flexibility (and uniformity) to JavaScript.
9. Var Declarations and Hoisting: Variable declarations using var are treated as if they are at the top of the function (or global scope, if declared outside of a function) regardless of where the actual declaration occurs; this is called hoisting. Consider the examples below:
function getValue(condition) {
if (condition) {
var value = “blue”;
// other code
return value;
} else {
// value exists here with a value of undefined
return null;
}
// value exists here with a value of undefined
}
Behind the scenes, the JavaScript engine changes the getValue function to look like this:
function getValue(condition) {
var value;
if (condition) {
value = “blue”;
// other code
return value;
} else {
return null;
}
}
The declaration of value is hoisted to the top. The variable value is actually still accessible from within the else clause. If accessed from within the else clause, the variable value will be undefined because it hasn’t been initialized, it's initialized only in the If clause.
10. Block Binding in Loops: This is one area where developers most want block-level scoping of variables is within for loops, where the throwaway counter variable is meant to be used only inside the loop. For for this we have to use let not var, cause var is being hoisted. Follow the two examples below:
for (var i = 0; i < 10; i++) {
process(items[i]);
}
// i is still accessible here
console.log(i); // 10
The variable i is still accessible after the loop is completed because the var declaration gets hoisted. Using let instead, as in the following code to ignore this problem:
for (let i = 0; i < 10; i++) {
process(items[i]);
}
// i is not accessible here — throws an error
console.log(i);
In this example, the variable i only exists within the for loop.