DEV Community

benboorstein
benboorstein

Posted on

Quick Notes Based On "Builtins" Section of Frontend Masters' "Complete Intro to Web Development, v2"

What I did (in code):

    console.log('BEn BoOrstEiN'.toUpperCase()) // BEN BOORSTEIN
    console.log('BEn BoOrstEiN'.toLowerCase()) // ben boorstein

    console.log(Math.round(5.6)) // 6
    console.log(Math.floor(5.999)) // 5
    console.log(Math.ceil(5.1)) // 6

    console.log('Ben Boorstein'.substr(4, 5)) // Boors
    console.log('Ben Boorstein'.substr(2, 4)) // n Bo
    console.log('Ben Boorstein'.substr(6)) // orstein

What I did (in English):

  • Above are a few of the very many methods that are built in to JavaScript.
  • toUpperCase() is pretty self-explanatory: It converts the string before it to all uppercase letters.
  • toLowerCase() is pretty self-explanatory: It converts the string before it to all lowercase letters.
  • Math.round() rounds the number passed to it to the nearest integer.
  • Math.floor() rounds the number passed to it to the nearest integer less than or equal to the number.
  • Math.ceil() rounds the number passed to it to the nearest integer greater than or equal to the number.
  • substr() returns a section of the string before it. The first number passed to it represents the starting index. The second number passed to it represents how many of the next characters (including the character at the starting index) will be included. If there is no second number passed to it, then every character from the starting index through the end of the string is included.

What I learned:

  • From the above code, I didn't learn anything new. But it is very helpful to be reminded of how these types of methods work. And review, no matter the topic, is always welcome.
  • From other parts of this section of instruction, I didn't learn anything new.

What I still might not understand:

  • Nothing for this section.

Sentry image

Make it make sense

Only get the information you need to fix your code that’s broken with Sentry.

Start debugging →

Top comments (0)

Tiger Data image

🐯 🚀 Timescale is now TigerData: Building the Modern PostgreSQL for the Analytical and Agentic Era

We’ve quietly evolved from a time-series database into the modern PostgreSQL for today’s and tomorrow’s computing, built for performance, scale, and the agentic future.

So we’re changing our name: from Timescale to TigerData. Not to change who we are, but to reflect who we’ve become. TigerData is bold, fast, and built to power the next era of software.

Read more

👋 Kindness is contagious

Discover this thought-provoking article in the thriving DEV Community. Developers of every background are encouraged to jump in, share expertise, and uplift our collective knowledge.

A simple "thank you" can make someone's day—drop your kudos in the comments!

On DEV, spreading insights lights the path forward and bonds us. If you appreciated this write-up, a brief note of appreciation to the author speaks volumes.

Get Started