#100DaysOfCode Day 9: Review of JavaScript Built-in Objects

Just now catching up with blogging what I’ve been doing for the past couple of days.  If you all are following the challenge repo, you’ll see I’m actually on Day 11.  The challenge involves documenting what I’ve learned and worked on too though, so here’s a quick update on what I did this past Tuesday (Day 10 and 11 soon to come).

Working through Duckett’s book, I made sure to bookmark the chapter on built-in objects. I always forget the main methods you can call on the models. To review, there are three object models JavaScript is used on: (1) the browser object model, (2) document object model, and (3) global JS objects.  I summarized few common methods for each type below:

BOM —> creates a model of the browser or window tab

  • window.alert( ) : creates a pop up box with a message, the user has to click the X to exit
  • window.open( ) : opens a new browser window, the URL is specified as a parameter
  • window.print( ) : prints content entered by the user to the current page

DOM —>the topmost model that represents the current page in the browser

  • document.write( ) : writes text to the page
  • document.getElementById( ) : returns an element from the HTML script, the id is specified as the parameter
  • document.createElement( ) : creates a new element in the HTML script, element is specified as the parameter

Global objects —> objects not formed as model, represented as a string, number, or boolean

  • .toUpperCase( ) : transforms string text to uppercase
  • .split( ) : splits a string and indexes the characters in an array, useful for data wrangling
  • .replace( ) : takes a string or character as the first parameter, replaces it with the string or character in the second parameter

There are dozens more.  To get a comprehensive list of built-in objects in JavaScript, I recommend Mozilla’s Developer Network’s reference.

I’ve made it to Part II of the book which covers jQuery.  I’m pretty familiar with using the jQuery library for web interactivity, but I look forward to covering this section.  To see some short programs I’ve built with jQuery in the past, you can check out my CodePen account and fork what you wish under my jQuery collection.  Here’s the link to my Go Mario Go! program and my simple to-do list.  It’s looking like I should be finished with the book by Sunday.

Of course, I couldn’t forget to get some coding in! I updated my Bootstrappin’ Portfolio project as well adding more assets, pages, and content. Go to the repo and click on Day 9.

*** Day 9 Recap ***

  1. Finished Part I of Jon Duckett’s “JavaScript and jQuery”
  2. Resized, edited, and added custom images to the portfolio project
  3. Created a portfolio.html page and added 4 sections for showing work
  4. Added more custom styles to main.css file

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s