- Create a program that will add two numbers and return the answer
add(1,2) // should return 3
- Create a program that will add or subtract two numbers and return the answer
calculator(1, 2, "add") // should return 3
Let’s create a person in javascript. We could use a variable...
const person = "John Doe";
To print our person’s name we could do...
const person = "John Doe";
This is an array called gameOfThonesHouses. It is an array made up of objects. Each object represents a house in the game of thrones. Each house has a name, wikiSuffix, and people. People in a house is an array of objects. Each object represents a person. Each person has a name, description, imageSuffix, and wikiSuffix.
var gameOfThronesHouses = [
{
name: "Starks",
wikiSuffix: "House_Stark",
people: [
{
name: "Eddard \"Ned\" Stark",
description: "Lord of Winterfell - Warden of the North - Hand of the King - Married to Catelyn (Tully) Stark",
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function archiveMsgs() {for (i=0; i< $(".js-archive-thread").length; i++){ $($(".js-archive-thread")[i]).trigger("click");}} | |
archiveMsgs();setTimeout(function(){console.log("cleared");if($("li.next_page a").length){window.location.reload();}},2000); |