loading...
Jason Yu profile picture

Jason Yu

Jason Yu is a passionate real-life problem solver and musician.

Education

Imperial College London

Work

Software Engineer at Attest

All 153 comments

How to create range in Javascript

Looks great to me!

The best example to understand virtual DOM

Nice demonstration! I wrote an article (and gave a talk) on ...

JS / TS?

Ts

Thought on Vue 3 Composition API - `reactive()` considered harmful

Exactly! So just use ref!

Thought on Vue 3 Composition API - `reactive()` considered harmful

Yes. I actually proposed that to Evan before too. But after a...

how not to use reduce

ya except I'd not use a reduce.

how not to use reduce

Readability vs performance is a hard thing to argue. Everyone...

how not to use reduce

Try it out. Try to write code in a way so that "it explains i...

how not to use reduce

I disagree. it is not 70% slower. The first example is just...

how not to use reduce

this post is not about space / time performance. do-while / f...

Introducing Faviator: A simple easy favicon generator

In fact I am super busy with other stuff too. I'd be really h...

Introducing Faviator: A simple easy favicon generator

This is such an awesome idea! Do you wanna work with me on ma...

Writing cleaner code with the rule of least power #ROLP

Thank you! I have actually submitted a proposal to talk abo...

Writing cleaner code with the rule of least power #ROLP

😭 Thanks man! And you are as always supportive! πŸ’š The real...

How to work the keyword: this ?

A nice simplified explanation, yet not complete. Shameless...

1 to 50 - MAN VS SELENIUM

There is no need to use selenium. Just some simple javascri...

How it works - Custom spread operator [...5]

Generators are still vanilla javascript. But I understand y...

How it works - Custom spread operator [...5]

Very interesting take on using iterator on numbers! Thanks ...

String.prototype.replace asynchronously?

It's a function that return a promise of string. It can be ...

Javascript fetch, retry upon failure.

You can omit the await. I like putting await because it remin...

String.prototype.replace asynchronously?

I have edited accordingly. Not sure why this obvious error ...

Thought on Vue 3 Composition API - `reactive()` considered harmful

Hi. The image is intended to illustrate the problem with ...

Thought on Vue 3 Composition API - `reactive()` considered harmful

Why would .push more likely to introduce spaghetti code? ...

Thought on Vue 3 Composition API - `reactive()` considered harmful

If it is a computed ref, then I believe it will be recursiv...

Building a Simple Virtual DOM from Scratch

Thank you!

How to create range in Javascript

Just a variable name. Has no special meaning to the languag...

How to create range in Javascript

Haha! I like this idea!

If the World Wide Web were re-created today with no legacy dependencies, how would it be different?

By the time the web was built, it would have fallen behind ...

How to create range in Javascript

haha! nice solution John!

Building a Simple Virtual DOM from Scratch

since many people asked. i might write an eps 2 that could ...

Building a Simple Virtual DOM from Scratch

You are a hero! Thanks for pointing that out! πŸŽ‰πŸŽ‰πŸŽ‰ I'll chan...

Building a Simple Virtual DOM from Scratch

That's a great idea. As long as you credit me, feel free! P...

Who's looking for open source contributors? (Jan 14th edition)

Here is a really random project and is really easy to contr...

Javascript fetch, retry upon failure.

Thanks for your comments! I am not sure if I understand your ...

What's your favorite Vim trick?

Macro! Definitely macro! (Although it is a feature not a tr...

Why You Should Care What You NpmΒ Install

I have become such a paranoid now when installing packages ...

Building a Simple Virtual DOM from Scratch

did you write this code simply based on the "leap of faith...

Building a Simple Virtual DOM from Scratch

Oops, I just realised there is one more, which is when ther...

Building a Simple Virtual DOM from Scratch

I am sorry that my explanation didn't help. :( diff has tw...

Building a Simple Virtual DOM from Scratch

Sure. You have stepped into the common trap of thinking rec...

Building a Simple Virtual DOM from Scratch

Thank you so much for your kind words! I am very very glad ...

Live-coding Wednesdays - codewithjason

Can't wait to see you tomorrow!

Live-coding Wednesdays - codewithjason

Great!!! See you tomorrow then! :)

Silly Repos

nocodes!!!! github.com/kelseyhightower/nocode

Building a Simple Virtual DOM from Scratch

Just feel free to DM me on twitter. @ycmjason

Building a Simple Virtual DOM from Scratch

Thank you!!! Thanks for taking the time to read through thi...

The 7 Most Popular DEV Posts from the Past Week

πŸŽ‰πŸŽ‰πŸŽ‰πŸŽ‰πŸŽ‰πŸŽ‰πŸŽ‰πŸŽ‰πŸŽ‰πŸŽ‰πŸŽ‰

Building a Simple Virtual DOM from Scratch

Bless you too Linus!

How to create range in Javascript

I have adapted Namir's method (see comments). And it is pro...

How to create range in Javascript

Are you actually using this in production code? πŸ˜‚πŸ˜‚ You rea...

Building a Simple Virtual DOM from Scratch

share the post if you liked it! spread the knowledge! :)

Building a Simple Virtual DOM from Scratch

❀❀❀ thank you so much!!!!

Building a Simple Virtual DOM from Scratch

It's because of readers like you that make me feel motivated ...

Building a Simple Virtual DOM from Scratch

I am so glad I found someone who appreciate this. ❀❀

Building a Simple Virtual DOM from Scratch

Thank you so much! Writing clean and elegant code is my pas...

Here is a little script to grab a list of all font names on Google Fonts.

I am just running it once in a while.

Is `this` in Javascript bad?

const self = this is not solving the problem that this coul...

Is `this` in Javascript bad?

I don't understand. Can you elaborate what you mean? :)

String.prototype.replace asynchronously?

Thanks a lot for sharing your inspiring ideas. 🍻I will keep...

Learning JavaScript Design Patterns

Had a quick look at the "Creational Design Patterns". You ...

Awesome projects under 1000 stars (2) - Gridland

shamelessly dropping my own project

Functional programming basics part 1: Pure function

@tuxOr There is nothing to do with the signature of a func...

Limit concurrent asynchronous calls

This is nice! πŸ‘πŸ‘πŸ‘

Limit concurrent asynchronous calls

Thanks!! Benjamin's reply is accurate! :)

Limit concurrent asynchronous calls

oh, I mistyped haha! Thanks for catching this! asyncLimit ...

Limit concurrent asynchronous calls

But we need the async function fn to complete before resolv...

Array Chunking

This is because Array.prototype.splice does whatever it doe...

Array Chunking

because IMO that's not more elegant. I think guard clause...

Array Chunking

Nothing beats a recursive solution when it comes to eleganc...

My point of "vue" in React vs. Vue

Andddddd Vue is created by Evan You. Jason Yu loves Vue.

JavaScript Quiz Part 2

reverseStr = ss => [ss].reduce(([...ss]) => ss.revers...

Do you know about these SVG techniques?

You cannot use SVG as a favicon yet. So... there is at leas...

VIDEO: Understanding this with call, apply and bind

Pretty cool Gissur. Also check out my post about this :p ...

Github Guesser - A Starry Game - 2 weeks of data

Quite cool! Thanks for sharing this! But the stars doesn't ...

Let me explain to you what is `this`. (Javascript)

Haha! Ok, maybe a little less. I just went crazy and keep o...

What are your programming blogs?

Dev.to is where i put my blog. I also host the posts on my ...

Let me explain to you what is `this`. (Javascript)

Awww thanks so much! :D

Concurrent Iteration

I think what would be really nice to have is, instead of Pr...

Let me explain to you what is `this`. (Javascript)

I could add this in the note. Not sure where to fit it in t...

Let me explain to you what is `this`. (Javascript)

I have changed "caller" to "definer", which makes more sens...

Let me explain to you what is `this`. (Javascript)

You are absolutely right. I always suggest python as the fi...

Let me explain to you what is `this`. (Javascript)

Oh yes you are right, let me update it later. Thanks for th...

Let me explain to you what is `this`. (Javascript)

😁😁 that is a huge compliment thanks!

Let me explain to you what is `this`. (Javascript)

It makes code a little bit more reasonable. Babel has impl...

Let me explain to you what is `this`. (Javascript)

I am lucky I was just 3 years old at that time. 😌😌

Let me explain to you what is `this`. (Javascript)

Great question. You are getting Window because you are not ...

JavaScript: Equality insanity, or where x === 1 && x === 2

I got the second answer!! 😎😎

Let me explain to you what is `this`. (Javascript)

Thanks! :) I am glad the memes worked out ok

Follow Friday!

Follow me follow me!🀣

Looks like Vue.js will likely out-star React over the weekend!

Sarah is amazing. But ya, once you have seen how Vue works...

Looks like Vue.js will likely out-star React over the weekend!

So have u started looking at Vue yet? Be quick :)

How do I use .forEach on DOM Elements?

Wait, is this true? Eventually, I realized that timestamp...

My attempt on asyncToGenerator()

Nice work! It's just a proof of concept I guess. We all us...

How to use inline JavaScript with HTML? You definitely like really bad code

Haha, yes JSX is horrible code. πŸ˜‚πŸ˜‚

vue.js modules in the browser, the cheap way

Interesting idea! Thank you for sharing this. Just a few J...

Javascript fetch, retry upon failure.

It's alright, copy and pasting isn't very hard. Only thing is...

How to make functions partially applicable in Javascript

Thanks for clarifying this! I did do my research before dec...

goto - navigate to aliased directories

This make sense! Quite cool quite cool.

goto - navigate to aliased directories

Seems interesting. Just wondering why not just setting an ...

Explain Vue.js like I'm five

It's like the elder wand in harry potter which makes websit...

Introducing Faviator: A simple easy favicon generator

Haha! Thanks! Give me a star if you like it! :D

Is `this` in Javascript bad?

I am guessing when you do obj.fn in typescript, you still l...

Is `this` in Javascript bad?

that's not a great argument, but I like your thinking! xD

Show me your .gitignore

Can I do a promote a tool here for those who like building ...

Here is a little script to grab a list of all font names on Google Fonts.

looks like something similar exists. npmjs.com/package/jso...

Here is a little script to grab a list of all font names on Google Fonts.

Stay tuned. I will make one. :P

Here is a little script to grab a list of all font names on Google Fonts.

Hmm, I haven't look into jq yet, but I don't feel that jq i...

Is `this` in Javascript bad?

the only advantage that I could think of using this is the ...

Here is a little script to grab a list of all font names on Google Fonts.

Ya, but I guess some how want to run this script every time...

Is `this` in Javascript bad?

This I think really depend on the design of your system. ...

Here is a little script to grab a list of all font names on Google Fonts.

Hahahaa.. thanks!! XD

Your developer timeline

Haha! I even tried to make a login system with Dreamweaver ...

Tell Your Story: Has your application been hacked?

SQL injection :( I made the website when I was still very ...

Introducing Faviator: A simple easy favicon generator

Ohhh finally someone replying haha Thanks! Gradient is def...

Your developer timeline

It's funny, I have always wanted to deny learning anything ...

Your developer timeline

I started quite young, maybe at around 13? Year Elapsed...

Why not to use setInterval

How about making an async version of setInterval? Something l...

How to organise NPM scripts in package.json?

I definitely agree with you. A build/ directory is definite...

Which is faster: obj.hasOwnProperty(prop) vs Object.keys(obj).includes(prop)

Try a bigger object, say with 20000 keys.

Which is faster: obj.hasOwnProperty(prop) vs Object.keys(obj).includes(prop)

interesting, is this running on node?

Named functions vs Functions as variables in JavaScript

They are used differently as they behave differently. This ...

Wrote a very fast URL shortener

Running a database on your current server probably is the b...

Defense Against the Dark Arts: CSRF Attacks

Wow! How vivid this is! An I the only one who attempt to go...

Wrote a very fast URL shortener

I am curious. Why would file io be any faster than database...

Which is faster: obj.hasOwnProperty(prop) vs Object.keys(obj).includes(prop)

I bet it has to be Object.hasOwnProperty. Depending on the...

How to organise NPM scripts in package.json?

Yes! Although it isn't really a solution, it does the trick...

How to create range in Javascript

It's just personal taste I guess. I think code with less lo...

How to create range in Javascript

What do you think about it? I have implemented.

How to create range in Javascript

Haha! I totally understand what you mean. But still since E...

How to create range in Javascript

Yes! You are right! I will add a generator implementation a...

How to create range in Javascript

On the other hand, I am a big fan of Haskell. And we tend t...

How to create range in Javascript

I am quite against writing all functions as arrow functions...

How to elegantly flatten a list

my favourite quote of all time!

How to elegantly flatten a list

It is interesting! There are a few points about your soluti...

What are some useful npm packages I might not know about?

npmjs.com/package/gitignorer

loading...