A Smarter Way to Learn JS – Notes
asmarterwaytolearn.com/js/index-of-exercises.html
Some of the syntax is outdated but the exercises are fun
- Alerts
- Variables for Strings
- Variables for Numbers
- Variable Names Legal and Illegal
- Math Expressions: familiar operators
- Math Expressions: unfamiliar operators
- Math Expressions: eliminating ambiguity
- Concatenating text strings
- Prompts
- if statements
- Comparison operators
- if…else and else if statements
- Testing sets of conditions
- if statements nested
- Arrays
- Arrays: adding and removing elements
- Arrays: removing, inserting, and extracting elements
- for loops
- for loops: flags, Booleans, array length, and loopus interruptus
- for loops nested
- Changing case
- Strings: measuring length and extracting parts
- Strings: finding segments
- Strings: finding a character at a location
- Strings: replacing characters
- Rounding numbers
- Generating random numbers
- Converting strings to integers and decimals
- Converting strings to numbers, numbers to strings
- Controlling the length of decimals
- Getting the current date and time
- Extracting parts of the date and time
- Specifying a date and time
- Changing elements of a date and time
- Functions
- Functions: passing them data
- Functions: passing data back from them
- Functions: local vs. global variables
- switch statements: how to start them
- switch statements: how to complete them
- while loops
- do…while loops
- Placing scripts
- Commenting
- Events: link
- Events: button
- Events: mouse
- Events: fields
- Reading field values
- Setting field values
- Reading and setting paragraph text
- Manipulating images and text
- Swapping images
- Swapping images and setting classes
- Setting styles
- Target all elements by tag name
- Target some elements by tag name
- The DOM
- The DOM: Parents and children
- The DOM: Finding children
- The DOM: Junk artifacts and nodeType
- The DOM: More ways to target elements
- The DOM: Getting a target’s name
- The DOM: Counting elements
- The DOM: Attributes
- The DOM: Attribute names and values
- The DOM: Adding nodes
- The DOM: Inserting nodes
- Objects
- Objects: Properties
- Objects: Methods
- Objects: Constructors
- Objects: Constructors for methods
- Objects: Prototypes
- Objects: Checking for properties and methods
- Browser control: Getting and setting the URL
- Browser control: Getting and setting the URL another way
- Browser control: Forward and reverse
- Browser control: Filling the window with content
- Browser control: Controlling the window’s size and location
- Browser control: Testing for popup blockers
- Form validation: text fields
- Form validation: drop-downs
- Form validation: radio buttons
- Form validation: ZIP codes
- Form validation: email
- Exceptions: try and catch
- Exceptions: throw
- Handle events within JavaScript