正在加载视频...

视频加载失败

🔥 4 JavaScript console tips: $, $$, $0 → $4 and $_

169,309 次观看 • 3 年前 •via X (Twitter)

10 条评论

Sam Sedighian 的头像
Sam Sedighian3 年前

Amazing how you are fitting so much in such short video! Well done as always @wesbos 👏🏼

Wes Bos 的头像
Wes Bos3 年前

thanks!

Corey Salzano 的头像
Corey Salzano3 年前

Very cool

Gonçalo Dias 的头像
Gonçalo Dias3 年前

Interesting, almost like jQuery but on the browser console.

Neil Chudleigh 的头像
Neil Chudleigh3 年前

Damn! Those are good ones, going to try and use em today.

Catalin Rosu 的头像
Catalin Rosu3 年前

Nice tips, Wes! I wrote the following a while ago and, in case it helps, $r or $vm0 return the respective React or Vue components too:

Marco Biedermann 的头像
Marco Biedermann3 年前

Maybe worth mentioning this is a feature in the @ChromeDevTools console only. This is not part of the JS spec. So it does not work in Node or any other environments.

Not Penny’s Boat 🛥️ 的头像
Not Penny’s Boat 🛥️3 年前

I had no idea until literally last week! My knowledge has only gone as far as $0. Have always been typing the full document.querySelector() bs...

Marcel Cruz 的头像
Marcel Cruz3 年前

I never knew beyond the single $. Thanks for so many tips in only one video!

Matvey 的头像
Matvey3 年前

You can also use copy() function to copy something to the clipboard from the console.

相关视频