A potent pair of keywords in standard JavaScript ES2017.

Photo by Ferenc Almasi on Unsplash

JavaScript language is single-thread, i.e., only one thread only to execute the command line. If running under a synchronized (synchronous), then when performing complex calculations, call AJAX request to the server, call the database (in NodeJS), this thread will stop waiting to do the whole browser is… crash.

To avoid this, most code call AJAX request or database in JavaScript are running under the asynchronous. Initially, the running code asynchronous in JavaScript is a reality thanks to the callback (as the code below).

// Pass callback to function ajax var callback…

The promise is used quite a lot in both front-end (AngularJS) and back-end (NodeJS), so mastering this concept will help you a lot in coding and interviews.

Photo by Max Chen on Unsplash

Asynchronous programming in Javascript

Anyone who has ever done AJAX knows that Javascript ; the asynchronously connects to the server functions behind do not wait for the AJAX function to finish but continue to run.

var xxxImage = ajax.get("hotgirl.info");
console.log(xxxImage);

Therefore, to get the result of the ajax function, we must pass it a callback. After the AJAX function gets the result, it will call the callback function with the result obtained.

// Pass callback to function…

These are the three functions that make up the power and dominance of JavaScript.

Photo by Shahadat Rahman on Unsplash

Bind is a function in Function.prototype so that the only function can call it. As mentioned in this article, bind is used to specify this parameter for a function.


We will discuss three features of OOP, compare their implementation in Java and JavaScript.

Photo by Christopher Gower on Unsplash

Because the Wiki is already available, I just copied it, do not explain again around:

  • Encapsulation: Hide information. This property does not allow the user of objects to change the intrinsic state of an object. Only the internal methods of an object allow to change its state. It is up to the code writer to allow the external environment to influence the internal data of an object. This is property to ensure the integrity of the object.
  • Inheritance: This property allows one object to make available…

One of the most troublesome things is the management and security of user information.

Photo by Martin LONGIN on Unsplash

Really! Signing up is difficult?

Unlike you might imagine, registering / logging in and managing users is not that simple at all. It can get pretty messy with the following features:

  • Allow users to register, log in by email
  • User decentralization
  • Integration with Gmail, Facebook
  • Integration with existing user systems in the enterprise
  • Reset password when users forget
  • Block account when a user enters wrong password many times
  • Secure API with mobile app
  • Two factor authentication (two factor authentication) with important accounts
  • Management: Add, delete, delete, edit users

A rather complex roundabout concept that is easy to make front-end developers crazy.

Photo by Sigmund on Unsplash

What is a prototype?

When another developer keeps coming up and asking you, “What the heck is a prototype?”, Answer it: It’s your father’s head, asking questions. This answer is somewhat ludicrous but quite accurate; it can be understood that prototype is either the template or the parent of an object.

In JavaScript, except for undefined, all other types are objects. The string, number, and boolean types are String, Number, and Boolean objects, respectively. Arrays are objects of Array form; functions are objects of Function form. The prototype of each object…


Hackers can sit at website A and seduce users to attack site B and other site C.

Photo by Samet Özer on Unsplash

In the Romance of the Three Kingdoms, talented military masters who have the talent of manipulating their thoughts sit in stubbornly determined stubbornly thousands of miles away.

This article will explain how hackers attack and also guide you on how to prevent them.

The fundamental of CSRF

CSRF’s full name is Cross-Site Request Forgery (Another name is XSRF). This vulnerability is quite common, and Netflix and Youtube have also been victims of vulnerability.

The consequences caused by it are also “quite” serious, so CRSF is pleased to…


This — keywords easy to make headache the programmers js.

Photo by Zachary Keimig on Unsplash

When we first learn, this is also quite simple and harmless. If you’ve ever learned Java or C #, you must remember this keyword is used to point to the object that calls the function. In javascript, this keyword plays a similar role. In the code below, we will see that this returns the object person and prints out exactly what we want.

var person = { firstName: 'Hoang', lastName: 'Pham', showName: function () { console.log (this.firstName + '' + this.lastName); } }; // Serialize will lose the method, only keep the properties JSON.stringify (person); // '{"firstName": "John", "lastName": "Wick"}'…

A “strange” security hole with a long, and difficult-to-read name.

Photo by Markus Spiske on Unsplash

What is strange?

This security hole is “strange” in that it is in the top 4 OWASP, but there is very little documentation about it. It is not known as XSS or CSRF or SQL Injection (Although its OWASP rank is much higher than XSS or CSRF).

I myself have never heard of the press or news mentioning this error before. Is it possible that there are no well-known cases related to it, or is it because the bug has many complex variations?

The main cause of this vulnerability is the carelessness of…


Javascript is originally designed in a rudimentary way, used to validate on the client-side.

Photo by Luca Bravo on Unsplash

If you follow the career of a web developer, you must work every day with js. Js itself is bad, but it comes with countless beneficial libraries/frameworks (jQuery, AngularJS, …); thanks to NodeJS, it even encroaches on the back-end.

In the first lesson, I will introduce the most basic knowledge in JavaScript: object.

What the hell is an Object?

Anyone who has studied Object-Oriented Programming knows about Class and Object concepts. However, there are no Classes but only Objects in JavaScript, so that it won't be obvious for some. In OOP languages…

Beribey

Always be nice to anybody who has access to my toothbrush.

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