Computer Science 103:

Web Development

Gregory M. Kapfhammer


flickr photo by SaurabhChatterjee shared under a Creative Commons (BY-NC-ND) license

Keep in Touch!

Course Web Site

Office Hours

Teaching Assistants

Slack Communication

Relevant Tweets

Email Communication


flickr photo by SaurabhChatterjee shared under a Creative Commons (BY-NC-ND) license

Color Scheme

Key Concept

Corresponding Diagram

In-Class Discussion

In-Class Activity

Details in the Textbook

JavaScript

Object-oriented, dynamically typed scripting language

What do those words mean?

Primarily used for client-side scripting

Downloading and executing a client-side JavaScript

Benefits of using JavaScript?

Drawbacks of using JavaScript?

Differences with prior material?

You've seen examples throughout the semester!

JavaScript's Location

Inline

Embedded

External

Alternatives similar to CSS programming!

How does JavaScript influence accessibility?

Variables and data types

See Figure 8.7 for an example

Primitive data types

Reference data types

See page 339 for an example

How do I make the JavaScript produce output?

document.write()

alert()

Conditional Logic

Allows the program to make decisions

If Statements

Allows us to implement conditional logic

if (age > 50)

if (hoursOfDay > 4 && hoursOfDay < 12)

There is an else component for a backup plan

Any questions about the use of this construct?

Review Section 8.5 for more details

Get ready for a strange term! 😼

Truthy and falsy

Everything in JavaScript has an inherent boolean!

Falsy values include false, null, and ""

Iteration Constructs

Perform some action repeatedly

Looping constructs: for, while, do-while

What are the similarities and differences?

When would you decide to use a certain construct?

Loops can tax the resources of a computer

Arrays

Arrays allow you to store a fixed number of variables

All values in the array are normally of the same type

Indexing an array can lead to exception cases

Any questions about using arrays in JavaScript?

See Figure 8.13 for more details!

One-dimensional arrays

Two-dimensional arrays

Indexing an array

years[i]

month[0][3]

Declaring and referencing objects

See Listing 8.10 for an example

Declaring a function

Invoking a function

See the textbook for additional details

Scope in JavaScript

Local versus global scope

Talk with two or three other students

Prepare one question about JavaScript

Post your question on #general in Slack

We will try some of this in assignments!

You can learn more in CMPSC 100!

Any questions about JavaScript programming?