Sign in

In this article, I will explain object destructuring using pure Javascript and provide some examples of how I use it in my react project

How to use it with pure Javascript

  1. basic extract


Recently I am working on an app that required me to compare the DateTime data from API between my local pc time. Below I have listed out some useful method that I always use to help me compare and present the right time

Get local time

By default, when you are setting up a new Date Object, it will return a date object with your browser's time

After creating a Date object, you can use below method to get the data you need


Const and Let is a new feature introduced in ES6. This article will explain the difference and usage of const and let

Definition

First of all, let’s take a look at the definition in MDN

  • Const : block-scoped, much like variables declared using the let keyword. The value of a constant can't be changed through reassignment, and it can't be redeclared.
  • Let: statement declares a block-scoped local variable, optionally initializing it to a value.

Toddypet

Hello, I am Heidi. I started this medium blog to post all of the note I have when I am learning new things. Hope this will be helpful for you as well :)

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