Open in app

Sign In

Write

Sign In

fatfish
fatfish

8.2K Followers

Home

About

Published in

JavaScript in Plain English

·Pinned

Interviewer: Can (a==1 && a==2 && a==3) Ever Evaluate to ‘true’ in JavaScript?

Yes, it can be true, and there are 6 ways — amazing! — Recently, I was asked a very interesting interview question: Can (a== 1 && a==2 && a==3) ever evaluate to true in JavaScript?. I almost lost the job opportunity because I couldn’t answer. At that moment, I was shocked by the question and thought the interviewer was joking.

Front End Development

4 min read

Interviewer: Can (a==1 && a==2 && a==3) ever evaluate to true in JavaScript?
Interviewer: Can (a==1 && a==2 && a==3) ever evaluate to true in JavaScript?
Front End Development

4 min read


Published in

JavaScript in Plain English

·Pinned

“I Lost a Job Opportunity Just Because of Promise.all”

An interview experience that made me so sad. — This is an interview experience that happened to my friend not long ago. The interviewer wanted him to implement the Promise.all function. Unfortunately, my friend didn't play well on the spot and couldn't answer the question. After the interview, the interviewer rudely said to him: “Your foundation of JavaScript is…

Front End Development

4 min read

“I Lost a Job Opportunity Just Because of Promise.all”
“I Lost a Job Opportunity Just Because of Promise.all”
Front End Development

4 min read


Published in

JavaScript in Plain English

·Pinned

It’s 2022, Don’t Just Use React Anymore

Do you only use React? Do you know Vue? — Recently, my friend failed an interview simply because she was not familiar with Vue.js. She usually uses React most of the time at work, so she didn’t bother to learn about other front-end frameworks. Should we be familiar with all the front-end frameworks in the world? No, that is extremely…

React

5 min read

It’s 2022, Don’t Just Use React Anymore
It’s 2022, Don’t Just Use React Anymore
React

5 min read


Published in

JavaScript in Plain English

·Pinned

Interviewer: What Happened to “npm run xxx”?

A secret that most people don’t know. — Preface Recently, I participated in an interview that made a deep impression on me. After many twists and turns, I finally got the offer. You can’t imagine what I went through. 1. My interview process Interviewer: Please tell me what happened when “npm run xxx”? The more detailed the better. Me: I thought to myself…

Front End Development

6 min read

Interviewer: What Happened to “npm run xxx”?
Interviewer: What Happened to “npm run xxx”?
Front End Development

6 min read


Published in

JavaScript in Plain English

·Pinned

7 ES6 JavaScript Tricks to Make You a Better Programmer

Make your JavaScript more readable and extensible with these ES6 code tips. — Preface ES6 has brought us a lot of convenience in programming. The functions that used to be realized with a lot of code have now become very concise. This article summarizes 7JavaScript tricks I often use in my work, I hope it can help you too. 1. Find the max or min value in the array Sometimes, we need to find…

Front End Development

3 min read

7 ES6 JavaScript Tricks to Make You a Better Programmer
7 ES6 JavaScript Tricks to Make You a Better Programmer
Front End Development

3 min read


Published in

JavaScript in Plain English

·13 hours ago

20 Powerful and Useful Regular Expressions Every Senior Web Engineer Should Master

Regular expressions are worth learning for every front-end engineer — 1. Formatting money I often need to format money at work and using regex makes it really easy. const formatPrice = (price) => { const regexp = new RegExp(`(?!^)(?=(\\d{3})+${price.includes('.') ? '\\.' : '$'})`, 'g') return price.replace(regexp, ',') } formatPrice('123') // 123 formatPrice('1234') // 1,234 formatPrice('123456') // 123,456 formatPrice('123456789') // 123,456,789 formatPrice('123456789.123') // 123,456,789.123

Front End Development

5 min read

20 Powerful and Useful Regular Expressions Every Senior Web Engineer Should Master
20 Powerful and Useful Regular Expressions Every Senior Web Engineer Should Master
Front End Development

5 min read


Published in

JavaScript in Plain English

·1 day ago

I Failed an Interview, but I Learned a Lot from It

Front-end engineers also need to learn algorithms I want to change to a new job. Before the interview, I prepared a lot of questions about front-end development, but I didn’t organize knowledge about algorithms. I thought I was very confident, but I didn’t expect to suffer a lot from the…

Front End Development

4 min read

I Failed an Interview, but I Learned a Lot from It
I Failed an Interview, but I Learned a Lot from It
Front End Development

4 min read


2 days ago

As a Front-End Engineer, 4 React Traps And TipsYou Should Know About

4 very useful React tips. — 1. Don’t forget to remove the listener when the component is Unmounting. We often need to listen to keyboard events, mouse events, etc. in useEffect of React. But we often forget to remove them. const windowScroll = () => { console.log('scroll') } useEffect(() => { window.addEventListener("scroll", windowScroll, false) }, []) Yes, when we return to this component, the scroll event will be…

Front End Development

3 min read

As a Front-End Engineer, 4 React Traps And TipsYou Should Know About
As a Front-End Engineer, 4 React Traps And TipsYou Should Know About
Front End Development

3 min read


Published in

JavaScript in Plain English

·5 days ago

Top 15+ GitHub Repos Every Developer Should Know About

Accelerating Your Path to Become a Programmer GitHub is one of our favourite sites that represents the spirit of open source. We can find free ebooks from there, discuss the most popular technical topics of the day, improve our coding skills, and more. In this post, I want to share…

Front End Development

6 min read

Top 15+ GitHub Repos Every Developer Should Know About
Top 15+ GitHub Repos Every Developer Should Know About
Front End Development

6 min read


Published in

JavaScript in Plain English

·Jun 2

How to Eliminate Regular Expression Denial of Service

Regular expressions are easy to learn — Preface Are you the kind of person who doesn’t want to learn regular expressions because they look complicated? Don’t worry, I used to be the same but not anymore. My boss once told me, “Can’t you learn such a simple regular expression?” In order to learn regular expressions, I read many…

Front End Development

5 min read

How to Eliminate Regular Expression Denial of Service
How to Eliminate Regular Expression Denial of Service
Front End Development

5 min read

fatfish

fatfish

8.2K Followers

Hi friends, I am a front-end engineer from Alibaba, let’s code happily together.

Following
  • Andrew Zuo

    Andrew Zuo

  • Ariel Meadow Stallings

    Ariel Meadow Stallings

  • Dr Mehmet Yildiz

    Dr Mehmet Yildiz

  • Josef Cruz

    Josef Cruz

  • Manuelgudinogomez

    Manuelgudinogomez

See all (156)

Help

Status

Writers

Blog

Careers

Privacy

Terms

About

Text to speech

Teams