DEV Community

Cover image for TIL About .bold(), .blink(), and More JavaScript String Methods

TIL About .bold(), .blink(), and More JavaScript String Methods

Ben Myers on February 21, 2020

While playing around in the Chrome DevTools, I noticed a string method I had never seen before: .bold(). Curiosity got the better of me, and I gave...
Collapse
 
michelc profile image
Michel • Edited

The String object has so many methods: developer.mozilla.org/en-US/docs/W....

Maybe it would be better to emphasize "these methods are all officially deprecated" and write it in bold...

Collapse
 
bendmyers profile image
Ben Myers

I appreciate the feedback, and you're absolutely right. I've gone ahead and edited in a more prominent disclaimer. Thank you!

Collapse
 
helleworld_ profile image
DesirΓ© πŸ‘©β€πŸŽ“πŸ‘©β€πŸ«

OKAY what!

I've been with JS for many years and didn't had a single clue about this, how GREAT! Now I think of it, if we had functions for numbers why wouldn't they exist for strings too, right? haha πŸ˜†

Thank you so much, Ben!

Collapse
 
dexygen profile image
George Jempty • Edited

I think you might find this interesting too if you don't already know it. Let's say you have an element in your page with the id of "foobar" -- well then there will be a global variable named "foobar" that points to this element.

Collapse
 
rubenofen profile image
rubenofen

I'm going to use one of these today in my code :D :D

Collapse
 
bendmyers profile image
Ben Myers

😱

Collapse
 
mzaini30 profile image
Zen

Wow I just found out those tricks.