Tips
Tips and Tricks
2022/06/27 (增加連結)
Tips
JavaScript The Hard Parts — Part 1
execution context
call stack
JavaScript Under The Hood: Advanced Concepts Developers Should Know
JavaScript Tips — Good Constructs to Use
Don’t Use var, Use let or const
Use === or Object.is Instead of ==
undefined, null, 0, false, NaN, ‘’ (empty string) are all Falsy.
Use Semicolons for Line Termination
Use Class Syntax for Object Constructors
Javascript Baker’s Dozen : 13 Javascript one-liners
10 JavaScript One-liners You Have Got to Add Your Arsenal as a Developer
Fundamentals
Workflow
Operations
Functions
Asynchronous
Functional Programming
6 Cool Modern JavaScript Features Most Developers Don’t Know About
Is JavaScript the Best Language for New Coders?: Despite its many flaws, JavaScript just might be the best tinkering language for kids and new learners
Now for the problems…
JavaScript isn’t type safe
JavaScript doesn’t do OOP
The world is full of bad JavaScript code
JavaScript needs additional libraries and frameworks
JavaScript Event Loop
Web APIs You [Probably] Didn’t Know Existed
Functional Programming with JavaScript
RxJS + Redux + React = Amazing!
JavaScript Engines — How Do They Even?
Wait, You Can Do That With JavaScript…!?
Using WebAssembly and Threads
A Quest to Be a (Web) Master
Imagine This: A Web Without Servers
What’s New in JavaScript (Google I/O ’19)
127 Helpful JavaScript Snippets You Can Learn in 30 Seconds or Less
The Underscored Importance of Underscore (JS)
underscrore.js
_.invert
_.functions
_.extend
_.uniqueId
_.template
Some simple and amazing JavaScript tricks
Trick 1: Combining Multiple Objects
Trick 2: Inserting values in between an array
Trick 3: Get the current timestamp
Trick 4: Check if an object is an array
Trick 5: Object destructuring
Trick 6: Rest parameter syntax
10 Awesome Github Repos Every Web Developer Should Know
Awesome
List of (Advanced) JavaScript Questions
JavaScript Algorithms and Data Structures
Clean Code JavaScript
free-for.dev
Tech Interview Handbook
Effective Engineer — Notes
List of Free Learning Resources
Big List of Naughty Strings
Awesome First PR Opportunities
Sharing Code In a Large JavaScript Project
Locally Shared Git Project Folders
Most devs place their code into Git as a code repository for their project. Well, it’s also possible to create a shared folder as a repository in Git and clone it anywhere locally.
Automatic Dark Mode With JavaScript : Detecting Users’ OS Dark Mode Preference Using matchMedia()
Event target vs currentTarget in JavaScript: The Important Difference
The Do’s and Don’ts of Try-Catch in JavaScript
Don’t Use Try-Catch For Input Validation
Do Use Try-Catch for Error Handling
Do Use Try-Catch for Customizing Error Messages
Do Use Try-Catch to Catch ALL Exceptions
Don’t Use Try-Catch For Program Logic
3D
API
Array
Which is The Best Method To Find an Item in an Array of Arrays in JavaScript?
7 JavaScript one-liners to work with arrays and make you code cleaner
Console
Closure
Date
Formatting a date
Transforming a string representing a date into a Date object
Performing date arithmetics, e.g. calculating the distance between two dates or adding a hours, days, months, etc., to a given date
Formatting a date with moment.js and friends
Parsing a date with moment.js and friends
Date arithmetics with moment.js and friends
Probably the best choice right now is day.js
Formatting Dates with the DateTimeFormat Object
The Constructor and the Format Method
Other Instance Methods
Built in Date Object
Moment.js
JavaScript — What The Heck is UTC and Why You Need to Know This
What is UTC
Time Zone
The Boundary of Time Zone
Date Object in JavaScript
Formatting Relative Time with JavaScript’s RelativeTimeFormat Constructor
Intl.RelativeTimeFormat
Luxon, Day.js, date-fns and js-joda.
The Complete Guide to Date Manipulation in JavaScript
JavaScript Date Manipulation Libraries
Date-fns
Stop using MomentJs : date-fns
Luxon
Stop Using MomentJS. Here Is What You Should Use Instead : Luxon
Stop using Moment.js for Dates and Time in JavaScript : Luxon.js is the modern replacement of Moment.js
JavaScript Temporal API- A Fix for the Date API **還沒正式release
The Easiest Way To Format Dates In JavaScript : Internationalization API
Observer
3 Web Observers Every Web Developer Should Know
MutationObserver
ResizeObserver
IntersectionObserver
Object
Are JavaScript Object Properties Ordered?
When an object’s property keys are a combination of the above types, the object’s non-negative integer keys (enumerable and non-enumerable) are first added to the array in ascending order, then String keys are added in insertion order. Finally, Symbol keys are added in insertion order.
Proxy
Request
Scope
Editor
LocalStorage
Mail
PDF
DOM
How to Create and Manipulate DOM Nodes in Vanilla JS : Working with the DOM in Vanilla JS apps (part 1): Tips for creating and manipulating DOM nodes without frameworks.
Test
Flow
Build tools
Is Vite Better than Webpack? : Fixing Webpack’s developer experience with Vite: A modern JavaScript build tool
Struggling With Webpack? Understand It Through Illustrations
Package
Frameworks
Remix
Performance
Web Worker
Lazy Loading
Caching
Clean code
7 JS patterns junior developers should know well
Making Variables from Properties / destructuring assignment.
The Map data object
Deep dive into the arrow functions
Properties assignment to a function
Method chaining
JavaScript Antipatterns — Prototypes, Switch, and More
Built-in Prototypes
We should never add methods to built-in prototypes.
switch Pattern
Avoiding Implied Typecasting
Avoiding eval()
We shouldn’t use eval or related methods like the Function constructor or passing strings to setTimeout or setInterval .
Number Conversions with parseInt()
ESLint
Polyfill
Compiling vs. Polyfilling in JavaScript
Compiling means the compiler (Babel) performs syntax transforms, but it does not add any new JavaScript primitives.
Able to be compiled
Arrow functions
Async functions
Block scoped functions
Classes
Class properties
Computed property names
Constants
Decorators
Default parameters
Destructuring
Modules
Object rest/spread
Property Method assignment
When you add a polyfill, you are adding brand-new functionality to your JavaScript code that did not exist there before.
Need to be polyfilled
ArrayBuffer
Array.from
Array.of
Array#find
Array#findIndex
Function#name
Map
Number.isNan
Object.assign
Object.entries
Object.values
Promise
Set
String#includes
Symbol
WeakMap
WeakSet