DEV Community

benboorstein
benboorstein

Posted on • Edited on

Quick Notes Based On "Numbers, Strings, and Booleans" Section of Frontend Masters' "Complete Intro to Web Development, v2"

What I did (in code):

    const myFirstName = 'Ben'
    const myLastName = 'Boorstein'

    const sentenceOldWay = 'Hi, ' + myFirstName + ' ' + myLastName + ', ' + 'how are you?'
    const sentenceNewWay = `Hi, ${myFirstName} ${myLastName}, how are you?`

    console.log(sentenceOldWay)
    console.log(sentenceNewWay)

    Logs: Hi, Ben Boorstein, how are you?
    Logs: Hi, Ben Boorstein, how are you?

What I did (in English):

  • I declared a const variable called myFirstName and stored in it (i.e., assigned to it) 'Ben' (a string).
  • I declared a const variable called myLastName and stored in it (i.e., assigned to it) 'Boorstein' (a string).
  • I declared a const variable called sentenceOldWay and stored in it a string that combined the above variable strings and new strings, and I did this the old way, i.e., using string concatenation.
  • I declared a const variable called sentenceNewWay and stored in it a string that combined the above variable strings and new strings, and I did this the new way, i.e., using template literals (aka template strings).
  • I logged both sentenceOldWay and sentenceNewWay to the console.

What I practiced:

  • Same as above.

What I learned:

  • From the above code, I didn't learn anything new.
  • From other parts of this section of instruction, I didn't learn anything new, because I already knew it. But I was reminded that in JS what we would, in regular English, call integers and decimal numbers are both just considered Numbers, and that in JS decimal numbers are called 'floats'.

What I still might not understand:

  • Nothing for this section.

SurveyJS custom survey software

JavaScript UI Libraries for Surveys and Forms

SurveyJS lets you build a JSON-based form management system that integrates with any backend, giving you full control over your data and no user limits. Includes support for custom question types, skip logic, integrated CCS editor, PDF export, real-time analytics & more.

Learn more

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs