Skip to content

ngtranthanhtoan/js-short-syntax

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 

Repository files navigation

Collection of useful syntaxes in Javascript

Logical validation

Used when we want to compare two values; if two values are the same, it will return true; if not, a string will return.

const value = 'foo';
const value === 'bar' || "This value is not the same."
// This value is not the same.

Snippets

Filter falsy values

const arrayNames = ["Adam", "Eva", null, ''];
const filterNames = arrayNames.filter(Boolean)
// ["Adam", "Eva"];

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published