Saturday, February 4, 2023
HomeSoftware DevelopmentLegacy String Strategies for Producing HTML

Legacy String Strategies for Producing HTML

I am at all times actually excited to see new strategies on JavaScript primitives. These additions are acknowledgement that the language must evolve and that we’re doing thrilling new issues. That being stated, I someway simply found some legacy String strategies that you simply most likely should not use however have existed perpetually. Let’s have a look!

These legacy string strategies take a primary string of textual content and wrap it in a HTML tag of the identical identify:

"Whats up".huge() // "<huge>Whats up</huge>"
"Whats up".blink() // "<blink>Whats up</blink>"
"Whats up".daring() // "<b>Whats up</b>"
"Whats up".italics() // "<i>Whats up</i>"
"Whats up".hyperlink("https://davidwalsh.identify") // "<a href="https://davidwalsh.identify">Whats up</a>"

Native prototypes do not often take away strategies and for good motive — they’ll break web sites! I am shocked I did not find out about these strategies earlier than immediately. It is at all times enjoyable to see relics of the net previous although!

  • Convert XML to JSON with JavaScript
  • 7 Essential JavaScript Functions

    I bear in mind the early days of JavaScript the place you wanted a easy perform for almost every part as a result of the browser distributors applied options in another way, and never simply edge options, primary options, like addEventListener and attachEvent.  Occasions have modified however there are nonetheless a couple of features every developer ought to…



Please enter your comment!
Please enter your name here

two × two =

Most Popular

Recent Comments