Jonathan's public fiddles
-
HTML - Basic HTML + CSS Example
No-Library (pure JS), HTML, CSS, JavaScript
-
HTML - Span + Font Family
No-Library (pure JS), HTML, CSS, JavaScript
-
HTML - Span tags
No-Library (pure JS), HTML, CSS, JavaScript
-
HTML - Divs and A-hrefs
No-Library (pure JS), HTML, CSS, JavaScript
-
HTML - Font Color, Italics
No-Library (pure JS), HTML, CSS, JavaScript
-
HTML - Creating Tables
No-Library (pure JS), HTML, CSS, JavaScript
-
Javascript - Cash Register Example
No-Library (pure JS), HTML, CSS, JavaScript
-
Javascript - Public and Private Keys
//source:http://www.codecademy.com/courses/objects-ii/5/4?curriculum_id=506324b3a7dffd00020bf661 //The following lesson started off with grade1, grade2, and grade3 being public keys (e.g "this.grade1 = 4"). this.getGPA returned ("this.grade1 + this.grade2" + ....) //We made the individual grades private by making the keys private; we accomplished this by removing the "this." parameter and making the grades variables ("var"). We modified the .getGPA method by removing the "this." labeling. //Notice on line 21 that the FOR IN loop looks for public grades and then lists them. Fortunately, we've hid all the grades and only produce the overall GPA (line 27)
-
Javascript - FOR IN + IF Statement
// Our objective is to print out the various ways to say "hello" in multiple languages. We've used a FOR IN loop to circle through the "languages" variable. NOTE: One of the keys in languages is not a language, therefore We've also added an IF statement and TYPEOF operator to only return strings.
-
Javascript - Passing Public Arguments into access Private Variables
//In this program we are passing arguments to public functions. By doing so, we are unlocking private variables
-
Javascript - Private Variables
//Although we cannot directly access private variables from outside the class, there is a way to get around this. We can define a public method that returns the value of a private variable.
-
Javascript - Private Methods
//Private Methods enable you to limit access to certain attributes of a constructor. Below, we've made bankBalance a private Method.
-
Javascript - Prototype Chains
//A penguin is an animal and an emperor penguin is a penguin. Are emperor penguins animals too? Of course! //The "prototype chain" in JavaScript knows this as well. If JavaScript encounters something it can't find in the current class's methods or properties, it looks up the prototype chain to see if it's defined in a class that it inherits from. This keeps going upwards until it stops all the way at the top: the mighty Object.prototype (more on this later). By default, all classes inherit directly from Object, unless we change the class's prototype, like we've been doing for Penguin and Emperor.
-
Javascript - Interitance
inheritance lets us see and use properties and methods from another class. To say that Penguin inherits from Animal, we need to set Penguin's prototype to be Animal.
-
Javascript - PROTOTYPE
//Prototypes are like "this.value" statements for entire classes (e.g "Dog" or "Person"). You can assign prototypes to affect all classes.
-
Javascript - CLASS & PROTOTYPE descriptions
JavaScript automatically defines the prototype for class with a constructor. For example, our Dog constructor ensures that the Dog prototype has a breed property. Remember, the Dog prototype keeps track of what Dog has, doesn't have, can, or can't do.
-
Javascript - FOR IN Example 4
//A refresher on for-in loops. Here we can compare the printing of keys and the seperate printing their associated values.
-
Javascript - hasOwnProperty If/Else statement
//He we are practicing using the "hasOwnProperty" method. As you can see on Line 11, we use "hasOwnProperty("shorts")" to see if there is a "shorts" key in the object "suitcase"
-
Javascript - .hasOwnProperty Method
//Javascript has method called hasOwnProperty. This lets us know if an object has a particular property. //We show how to use hasOwnProperty in the last two lines. It returns true or false, based on whether an object has a certain property.
-
Javascript - TYPEOF operator
//the following example introduces the operator "typeof" which tells the user whether or not something is a string, number, object, or boolean