Intro To Programming
How the while loop works
And, when you need to make LOTS of decisions
Reach out and communicate with your user
A closer look at console.log
Opening the console
How do I add code to my page? (let me count the ways)
We’re going to have to separate you two
Let’s build a Battleship gameOur first attempt…First, a high-level designA few more details…
Working through the Pseudocode
Oh, before we go any further, don’t forget the HTML!
Writing the Simple Battleship code
Now let’s write the game logic
Step One: setting up the loop, getting some input
How prompt works
Checking the user’s guess
So, do we have a hit?
Adding the hit detection code
Hey, you sank my battleship!
Provide some post-game analysis
And that completes the logic!
Doing a little Quality Assurance
Can we talk about your verbosity…
Finishing the Simple Battleship game
How to assign random locations
The world-famous recipe for generating a random number
Back to do a little more QA
What’s wrong with the code anyway?By the way, did we happen to mention FUNCTIONS?Okay, but how does it actually work?What can you pass to a function?
Functions can return things too
Tracing through a function with a return statement
Global and local variables
Knowing the scope of your local and global variables
The short lives of variables
Don’t forget to declare your locals!
How to access an array item
Updating a value in the array
How big is that array anyway?
Meanwhile, back at Bubbles-R-Us…
How to iterate over an array
But wait, there’s a better way to iterate over an array
It’s that time again…. Can we talk about your verbosity?
Redoing the for loop with the post-increment operator
Quick test drive
Creating an array from scratch (and adding to it)
And the winners are…
A quick survey of the code…
Writing the printAndGetHighScore function
Refactoring the code using printAndGetHighScore
Putting it all together…
A trip to Objectville
Did someone say “Objects”?!Thinking about properties…How to create an objectWhat is Object-Oriented Anyway?
How properties work
How does a variable hold an object? Inquiring minds want to know…
Comparing primitives and objects
Doing even more with objects…
Stepping through pre-qualification
Let’s talk a little more about passing objects to functions
Oh Behave! Or, how to add behavior to your objects
Improving the drive method
Why doesn’t the drive method know about the started property?
How this works
How behavior affects state… Adding some Gas-o-line
Now let’s affect the behavior with the state
Congrats on your first objects!
Guess what? There are objects all around you! (and they’ll make your life easier)
Getting to know the DOM
A first taste of the DOM
Getting an element with getElementById
What, exactly, am I getting from the DOM?
Finding your inner HTML
What happens when you change the DOM
A test drive around the planets
Don’t even think about running my code until the page is fully loaded!
You say “event handler,” I say “callback”
How to set an attribute with setAttribute
More fun with attributes! (you can GET attributes too)
So what else is a DOM good for anyway?
The truth is out there…Watch out, you might bump into undefined when you aren’t expecting it…How to use nullDealing with NaN
It gets even weirder
We have a confession to make
Understanding the equality operator (otherwise known as ==)
How equality converts its operands (sounds more dangerous than it actually is)
How to get strict with equality
Even more type conversions…
How to determine if two objects are equal
The truthy is out there…
The Secret Life of Strings
How a string can look like a primitive and an object
A five-minute tour of string methods (and properties)
Chair Wars (or How Really Knowing Types Can Change Your Life)
Building an app
This time, let’s build a REAL Battleship gameStepping back… to HTML and CSSCreating the HTML page: the Big PictureAdding some more style
Using the hit and miss classes
How to design the game
Implementing the View
How displayMessage works
How displayHit and displayMiss work
How we’re going to represent the ships
Implementing the model object
Setting up the fire method
Implementing the Controller
Processing the player’s guess
Planning the code…
Counting guesses and firing the shot
How to add an event handler to the Fire! button
Passing the input to the controller
How to place ships
Writing the generateShip method
Generate the starting location for the new ship
Completing the generateShip method
Handling events What are events?What’s an event handler?
How to create your first event handler
Test drive your event
Getting your head around events… by creating a game
Implementing the game
Let’s add some more images
Now we need to assign the same event handler to each image’s onclick property
How to reuse the same handler for all the images
How the event object works
Putting the event object to work
Test drive the event object and target
Events and queues
Even more events
How setTimeout works
Finishing the image game
Test driving the timer
Liberated functionsThe mysterious double life of the function keywordFunction declarations versus function expressionsParsing the function declaration
What’s next? The browser executes the code
Moving on… The conditional
How functions are values too
Flying First Class
Writing code to process and check passengers
Iterating through the passengers
Passing a function to a function
Returning functions from functions
Writing the flight attendant drink order code
The flight attendant drink order code: a different approach
Taking orders with first class functions
How the array sort method works
Putting it all together
Take sorting for a test drive
Taking a look at the other side of functions…How to use an anonymous function We need to talk about your verbosity, again When is a function defined? It depends…
What just happened? Why wasn’t fly defined?
How to nest functions
How nesting affects scope
A little review of lexical scope
Where things get interesting with lexical scope
Calling a function (revisited)
What the heck is a closure?
Closing a function
Using closures to implement a magic counter
Looking behind the curtain…
Creating a closure by passing a function expression as an argument
The closure contains the actual environment, not a copy
Creating a closure with an event handler
How the Click me! closure works
Creating objects with object literalsUsing conventions for objectsIntroducing Object ConstructorsHow to create a Constructor
How to use a Constructor
How constructors work
You can put methods into constructors as well
It’s Production Time!
Let’s test drive some new cars
Don’t count out object literals just yet
Rewiring the arguments as an object literal
Reworking the Car constructor
Understanding Object Instances
Even constructed objects can have their own independent properties
Real World Constructors
The Array object
Even more fun with built-in objects
Extra strength objects
Hey, before we get started, we’ve got a better way to diagram our objects Revisiting object constructors: we’re reusing code, but are we being efficient?Is duplicating methods really a problem?What are prototypes?
Inheriting from a prototype
How inheritance works
Overriding the prototype
How to set up the prototype
Prototypes are dynamic
A more interesting implementation of the sit method
One more time: how the sitting property works
How to approach the design of the show dogs
Setting up a chain of prototypes
How inheritance works in a prototype chain
Creating the show dog prototype
Creating a show dog instance
final cleanup of show dogs
Stepping through Dog.call
The chain doesn’t end at dog
Using inheritance to your advantage… by overriding built-in behavior
Using inheritance to your advantage… by extending a built-in object
Grand Unified Theory of
Better living through objects
Putting it all together
- Duration and pricing
- Full-time over 5 days (R9995)
- Part-time over 4 weeks (2 nights per week, 3 hour sessions) (R11995)
- Part-time over 8 Saturdays, 3 hour sessions (R11995)
- Please note : For part-time courses we do not have a fixed schedule and you will be placed on a waiting list until we get a group of 4+ together. Please book with no dates on the bookings form. This will automatically put you on the waiting list. We will confirm with you as soon as we have a part-time group together.
- Distance-learning over up to 3 months (R9995)
- International exams are not included in the course price.
- Prices exclude Vat for Vat-registered companies
- Upon completion of this course we will issue you with attendance certificate to certify your attendance and / or completion of the prescribed minimum examples.
- You may sit for our competency assessment test and on passing you will obtain our competency certificate.
- Our competency assessment can be booked and taken by someone who has not attended the course at a cost of R950.
You can download the course registration form on our home page or by clicking here
You may download a pdf copy of this page by clicking on the pdf icon at the top of the page.
Please email us
On the calendar below. If your browser doesn’t display the calendar below, please click on this link or try using Google Chrome, alternatively please enquire via our Contact Us page.