JSFiddle

Jonathan's public fiddles

  • Javascript - Multidimensional Arrays

    //Did you know that you can have an Array within another Array? We call this a two-dimensional array! //This array is two-dimensional because it has two rows that each contain two items. If you were to put a new line between the two rows, you could log a 2D object—a square—to the console, like so: //[1,1] //[1,1]

  • Javascript - Iterate through FOR loop

    No-Library (pure JS), HTML, CSS, JavaScript

  • Javascript - SWITCH/AND/OR game

    No-Library (pure JS), HTML, CSS, JavaScript

  • Javascript - AND, OR, NOT

    //So far we've seen how to control our programs given a single condition: whether one variable is equal to a certain value, for instance. But what if we want to check more than one variable? //For this, we'll need logical operators. JavaScript has three: and (&&), or (||), and not (!). //source: http://www.codecademy.com/courses/javascript-beginner-en-qDwp0/2/1?curriculum_id=506324b3a7dffd00020bf661

  • Javascript - SWITCH function

    //As you might imagine, if you have a lot of choices you want to cover in a program, it might be annoying to type else if () ten times. That's why JavaScript has the switch statement! //switch allows you to preset a number of options (called cases), then check an expression to see if it matches any of them. If there's a match, the program will perform the action for the matching case; if there's no match, it can execute a default option. //see also: http://www.codecademy.com/courses/javascript-beginner-en-qDwp0/0/4?curriculum_id=506324b3a7dffd00020bf661

  • Javascript - For, While, and Do Loops

    No-Library (pure JS), HTML, CSS, JavaScript

  • Javascript - Do While

    No-Library (pure JS), HTML, CSS, JavaScript

  • Javascript - Comparing For and While loops

    An example where both the FOR and WHILE loop run the same process, but in a different manner

  • Javascript - Intermediate While Loops

    Taken from CodeAcademy, have a While Loop initiate 3 times and then stop using While, Count, and Count++

  • Javascript - "===" vs "=="

    //The differences between "===" and "==" in Javascript

  • Javascript - While Loops

    //Use "While" loops when you aren't quite sure when to "end" a "for" loop. For example, if you were searching through a deck of cards and wanted to "stop" when you hit your first spade, you wouldn't know exactly when to end, which would make "for" loops impossible to implement. //"while" loops are perfect to creating a "stop" point once a certain parameter is hit. //below is an example of flipping a coin and stopping when "tails" pops up

  • Javascript - For Loop Template

    //Below is an example of a Javascript "for" loop. The loop showcases the start, end, and "everything in between" processes.

  • Javascript - Search Text

    //From CodeAcademy, Javascript - "Listening In" (5/7) //The following code will enable users to search for their own name in text. The code works by searching for the first letter of myName, and then continues to look for the match based on you name's length. This code can be improved and will throw errors when "John" is added to the end of the "text" variable.

  • HTML Input tags

    The following is an example taken from https://dash.generalassemb.ly/projects/annas-website-1. As you can see, the HTML showcases Inputs, Types, and placeholders, relative and absolute URLs, and some CSS

  • Javascript Arrays

    This is an example using Javascript Arrays. As you can see, an array is classified when a variable has "[]". Strings and numbers can exist within the same array. Note: Arrays start at 0, therefore "cities[0]" = "Melbourne". This array ranges from 0 -> 3