Course

Introduction to Programming

Basic programming skills are essential for all web professionals, including designers. Many programming languages share a common set of concepts, which will be covered in this course.

Introduction to Programming

4 Achievements

Basics

Basics

Computer programming can be intimidating at first, but this gentle introduction to the subject will make the learning curve a bit easier to climb.

0 of 5 Steps Complete
Control Structures

Control Structures

Control structures determine the flow of execution within an application. A conditional statement can fork the execution down several paths or a loop can execute the same code several times until a condition is met.

  • 10:07

    If/Else
  • 13:23

    Loops
  • 5 questions

    Quiz
  • Extra Credit

    Fizz Buzz

    Write a program that loops through the numbers 1 through 100. Each number should be printed to the console, using console.log(). However, if the number is a multiple of 3, don't print the number, instead print the word "fizz". If the number is a multiple of 5, print "buzz" instead of the number. If it is a multiple of 3 and a multiple of 5, print "fizzbuzz" instead of the number.

    Hint. Use loops and if/else statments. In javascript the % is the modulo, or remainder operator. a % b evaluates to the remainder of a divided by b. 11 % 3 is equal to 2.

0 of 3 Steps Complete
Objects and Arrays

Objects and Arrays

An array is a way of storing multiple items and each item is associated to a number called the index. Each item can be accessed using the index value. Objects are usually associated to meaningful pieces of data which it can hold and manipulate.

  • 15:52

    Arrays
  • 11:07

    Objects
  • 5 questions

    Quiz
  • Extra Credit

    Try creating an object that represents you. Include all sorts of things about you, like your name as a string, and your favorite songs as an array. Explore how objects can be nested in other objects, and arrays.

0 of 3 Steps Complete
Functions

Functions

A function contains a piece of code that needs to be executed several times from different parts of your application. A function optionally takes in arguments and returns an object or value as a result.

  • 11:51

    Functions
  • 5 questions

    Functions
  • Extra Credit

    Create a function that takes 3 arguments, a, b, and c. If a is an even number have the function return the string "even". Otherwise have the function return the string "odd"

0 of 2 Steps Complete

Instructor

  • Jim Hoskins

    Jim is a full stack software developer at Treehouse. When he's not writing code, he's blogging, teaching, or speaking at conferences. On Twitter he is @jimrhoskins.

Download videos

You have to sign up for Treehouse in order to download course videos.

Sign up
<!-- Generator: Adobe Illustrator 18.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <!-- Generator: Adobe Illustrator 18.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <!-- Generator: Adobe Illustrator 18.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">