JavaScript- Must know this to become a professional

API, GET, POST:

An API delivers a user response to a system and sends the system’s response back to a user. Although POST and GET are the most commonly used HTTP request methods, they have many differences. While the HTTP POST method is used to send data to a server to create or update a resource, the HTTP GET method is used to request data from a specified resource and should have no other effect.

Event bubble:

Event bubbling directs an event to its intended target, it works like this: A button is clicked and the event is directed to the button. If an event handler is set for that object, the event is triggered. If no event handler is set for that object, the event bubbles up (like a bubble in water) to the parent of the object.

this Keyword:

In an object method, this refers to the “owner” of the method. It has different values depending on where it is used: In a method, this refers to the owner object. Alone, this refers to the global object. In a function, this refers to the global object. In a function, in strict mode, this is undefined.

Closure, encapsulation, private variable:

A private variable is only visible to the current class. It is not accessible in the global scope or to any of its subclasses. Encapsulation means information hiding. A closure is a combination of a function bundled together (enclosed) with references to its surrounding state (the lexical environment). A closure can be created as a function with a private state.

Truthy & Falsy value:

In JavaScript, a truthy value is a value that is considered true when encountered in a Boolean context. All values are truthy unless they are defined as falsy (i.e., except for false, 0, -0, 0n, “, null, undefined, and NaN ). An easy way of checking if a value is truthy or falsy is bypassing it to the Boolean constructor function.

Scope & Block Scope:

the scope is where you can refer to a variable. a block defines a block scope a variable defined inside a block will be defined only inside that block and you can’t reference it after the end of the block. … A method or field’s scope is the entire body of the class. The block statement is often called a compound statement in other languages. It allows you to use multiple statements where JavaScript expects only one statement.

Difference between bind, call, and apply:

We Use bind() when we want that function to later be called with a certain context, useful in events. Use call()or apply() when we want to invoke the function immediately and modify the context.

Call/apply call the function immediately, whereas bind() returns a function that, when later executed, will have the correct context set for calling the original function. This way you can maintain context in async callbacks and events.

Asynchronous Javascript setTimeout, setInterval:

setTimeout and setInterval are the only native functions of JavaScript to execute code asynchronously. setTimeout allows us to run a function once after the interval of time. setInterval allows us to run a function repeatedly, starting after the interval of time, then repeating continuously at that interval.

Arrow function, Multiple parameters, Function body:

An arrow function expression is a compact alternative to a traditional function expression. I short, it is the short form of a normal function. A JavaScript function does not perform any checking on parameter values (arguments).

callback function:

In JavaScript, a callback is a function passed into another function as an argument to be executed later. To find all the odd numbers in the array, you can use the filter() method of the Array object. The filter() method creates a new array with the elements that pass the test implemented by a function. Callbacks are generally used when the function needs to perform events before the callback is executed.

--

--

--

Love podcasts or audiobooks? Learn on the go with our new app.

API Testing With Postman Series — Part 2

Taiwan: The Water-starved Island — The Digital Back Story

v3.1.0: A massive performance boost and streaming server-side rendering support

Debounce and Throttle in Real Life Scenarios

UCB Coding boot camp — a reflection on the first group project

Add a Map To Your React App — For Free

Things that can go wrong without a strictly typed language — Part I

Let’s Create a Secure HD Bitcoin Wallet in Electron + React.js

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Mohammad Mehedi Hasan Bhuiyan

Mohammad Mehedi Hasan Bhuiyan

More from Medium

CREWORK WEB DEV COHORT: MY STORY

The demo day

Learning Modern JavaScript & JQuery

Escaping Tutorial Hell

Front-End and Back-End Development: What Is the Difference?