5 New JavaScript Features in ES 2020

In this Blog we are going to learn ES 2020 Key Features.ES2020 released on Start of this year.
Here we are going to learn some really cool features of ES 2020

Let’s start with Feature 1 : Nullish coalescing
Use when the value is missing (undefined or null (It doesn’t work with NaN , ‘’, 0)).
The undefined and null are the nullish value , and you want to handle it then we use nullish coalescing operator.
Example:
image
In above example , country is not there so it does show undefined And I want to print some meaningful result
Before ES 2020 we use truthy and falsy
image
It just checks if the first value is true then don’t go to the second value ,
if first is false (undefined or null ) then go to the second value.
Instead of PIPE Now Use Nullish Operator from ES 2020
image

Feature 2 : Optional Chaining Operator
Nested Object Property access can be dangerous , if any of the property is null or undefined.
Example :
image


Read Full Article Here – https://brain-mentors.com/5-new-javascript-features-in-es-2020-brain-mentors/

  • Issue by:Brain Mentors
  • Web:https://brain-mentors.com/5-new-javascript-features-in-es-2020-brain-mentors/
  • Street:H.No.-23, Ist & IInd floor, Blk- C, Pkt-9, opp. to Metro Pillar Number 400, , above 24 Seven, Sector 7, Rohini, Delhi, 110085
  • City:New Delhi
  • State/province:Delhi
  • Country/region:India
  • Zip:110085
  • Telephone:07042434524
  • About Viv-Media|Free Add URL|Submit Press Release|Submit How To|SiteMap|Advertise with Us|Help|Contact Viv-Media |China Viv-Media
  • Copyright© 2010-2020 viv-media.com Corporation.
    Use of this web constitutes acceptance of Terms of Service and Privacy Policy. All rights reserved.  Poetry Online :Ancient Chinese Poetry