Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Wow. Because this surprised me so much, I just found out that if you open up a node REPL and type 'hello'.blink() you get '<blink>Hello</blink>' returned. So I guess it's an ES thing and it boggles my mind.

I was trying to find the ES standard where it's specified but I'll settle for this[1] instead. Interestingly enough you have quite a few HTML wrapping functions as part of the spec.

[1]: http://javascript.spec.whatwg.org/#string.prototype.blink



What could possibly be the use of that.


    <p style="color: red">
    <script>
        var str="&bull;";
        document.write(str.blink());
    </script>
    </p>
That would make a blinking red dot. It'd be good for status lights, I guess.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: