Image for post
Image for post
Photo by MORAN on Unsplash

Introduction

In this article, we will discuss What Synchronous Programming is? What Asynchronous Programming is? And whether JavaScript is Synchronous or Asynchronous?

Many developers struggle to understand topics like Callbacks, Promises, and Async/Await, one of the reasons may be not understanding the actual need and core logic behind them.

Having a good grasp of this topic can help you understand them more easily.

Example

This can be better explained with the help of an example.
Imagine you gave your friend a set of tasks:

  • Get Video Games from adjacent towns (somewhere far).
  • Get Chocolate from a nearby store.

What your friend now does is, he first completes task one and head to an adjacent town, and let’s say that takes x amount of time. Then he comes back to you, gives you video games, and then goes to perform the second task, and let’s say it takes y amount of time. The total time taken is x+y. This was just a couple of tasks but imagine there are hundreds of them, the total time is taken increases rapidly if he is a single person doing all the tasks one by one in the order they are given. …


And is it really so dangerous?

Image for post
Image for post
Photo by WOCinTech Chat on Flickr

In this article, we will be discussing what dangerouslySetInnerHTML is, how it is used, what the differences are between dangerouslySetInnerHTML and innerHTML, and a real project where it proves to be useful.

What?

dangerouslySetInnerHTML is an attribute under DOM elements in React.

According to the official documentation, dangerouslySetInnerHTML is React’s replacement for using innerHTML in the browser DOM.

This means that if in React if you have to set HTML programmatically or from an external source, you would have to use dangerouslySetInnerHTML instead of traditional innerHTML in Javascript.

In simple words, using dangerouslySetInnerHTML, you can set HTML directly from React.

How?

First, let’s take a look at how innerHTML…


Image for post
Image for post
Photo by Fernando Hernandez on Unsplash

In this post, we are going to build a pokemon index using Pokemon API in plain Javascript. First, let’s discuss what this project is about, there will be a search bar where users can come and search for a pokemon and after the search, pokemon with its image and stats, as a result, will be shown. So, the functionality is pretty basic but you using this project as a base can tweak and make your own version of this project and add it to your portfolio.

The full version is deployed at https://poke-mon.now.sh/

This project is inspired by Chris on…

About

Ashutosh K Singh

Writer, Learner, JavaScript Developer, working on https://finalspaceapi.com

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