Skip to content
This repository was archived by the owner on Jan 14, 2024. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 36 additions & 36 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
<!--

The title for your pull request should be made in this format

CITY CLASS_NO - FIRST_NAME LAST_NAME - MODULE - WEEK_NO

For example,

London Class 7 - Chris Owen - HTML/CSS - Week 1

Please complete the details below this message

-->

**Volunteers: Are you marking this coursework?** _You can find a guide on how to mark this coursework in `HOW_TO_MARK.md` in the root of this repository_

# Your Details

- Your Name:
- Your City:
- Your Slack Name:

# Homework Details

- Module:
- Week:

# Notes

- What did you find easy?

- What did you find hard?

- What do you still not understand?

- Any other notes?
<!--
The title for your pull request should be made in this format
CITY CLASS_NO - FIRST_NAME LAST_NAME - MODULE - WEEK_NO
For example,
London Class 7 - Chris Owen - HTML/CSS - Week 1
Please complete the details below this message
-->
**Volunteers: Are you marking this coursework?** _You can find a guide on how to mark this coursework in `HOW_TO_MARK.md` in the root of this repository_
# Your Details
- Your Name:
- Your City:
- Your Slack Name:
# Homework Details
- Module:
- Week:
# Notes
- What did you find easy?
- What did you find hard?
- What do you still not understand?
- Any other notes?
34 changes: 17 additions & 17 deletions .github/workflows/close.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
name: "Close stale issues and PRs"
on:
workflow_dispatch:
schedule:
- cron: "30 1 * * *"

jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v3
with:
stale-pr-message: "Your coursework submission has been closed because nobody has interacted with it in six weeks. You are welcome to re-open it to get more feedback."
days-before-stale: 42
days-before-close: 0
days-before-issue-stale: -1
days-before-issue-close: -1
name: "Close stale issues and PRs"
on:
workflow_dispatch:
schedule:
- cron: "30 1 * * *"
jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v3
with:
stale-pr-message: "Your coursework submission has been closed because nobody has interacted with it in six weeks. You are welcome to re-open it to get more feedback."
days-before-stale: 42
days-before-close: 0
days-before-issue-stale: -1
days-before-issue-close: -1
28 changes: 14 additions & 14 deletions .github/workflows/extra-tests.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
name: Run extra tests
on:
pull_request:
paths:
- 3-extra/**
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install modules
run: npm install
- name: Run extra tests
run: npm run extra-tests
name: Run extra tests
on:
pull_request:
paths:
- 3-extra/**
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install modules
run: npm install
- name: Run extra tests
run: npm run extra-tests
22 changes: 11 additions & 11 deletions .github/workflows/mandatory-tests.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: Run mandatory tests
on: pull_request
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install modules
run: npm install
- name: Run mandatory tests
run: npm test
name: Run mandatory tests
on: pull_request
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install modules
run: npm install
- name: Run mandatory tests
run: npm test
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
node_modules
.DS_Store
package-lock.json
node_modules
.DS_Store
package-lock.json
.prettierrc
38 changes: 19 additions & 19 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
{
"arrowParens": "always",
"bracketSpacing": true,
"embeddedLanguageFormatting": "auto",
"htmlWhitespaceSensitivity": "css",
"insertPragma": false,
"jsxBracketSameLine": false,
"jsxSingleQuote": false,
"printWidth": 80,
"proseWrap": "preserve",
"quoteProps": "as-needed",
"requirePragma": false,
"semi": true,
"singleQuote": false,
"tabWidth": 2,
"trailingComma": "es5",
"useTabs": false,
"vueIndentScriptAndStyle": false
}
{
"arrowParens": "always",
"bracketSpacing": true,
"embeddedLanguageFormatting": "auto",
"htmlWhitespaceSensitivity": "css",
"insertPragma": false,
"jsxBracketSameLine": false,
"jsxSingleQuote": false,
"printWidth": 80,
"proseWrap": "preserve",
"quoteProps": "as-needed",
"requirePragma": false,
"semi": true,
"singleQuote": false,
"tabWidth": 2,
"trailingComma": "es5",
"useTabs": false,
"vueIndentScriptAndStyle": false
}
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"jira-plugin.workingProject": ""
}
54 changes: 27 additions & 27 deletions 1-exercises/A-accessing-values/exercise1.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
/*
This object has 4 properties
The properties of the object are all primitive types (string, number or boolean)
What is the type of each property?
*/

let dog = {
breed: "Dalmatian",
name: "Spot",
isHungry: true,
happiness: 6
};

/*
You can access the values of each property using dot notation.
Log the name and breed of this dog using dot notation.
*/

let dogName; // complete the code
let dogBreed; // complete the code

console.log(`${dogName} is a ${dogBreed}`);

/* EXPECTED RESULT

Spot is a Dalmatian

/*
This object has 4 properties
The properties of the object are all primitive types (string, number or boolean)
What is the type of each property?
*/
let dog = {
breed: "Dalmatian",
name: "Spot",
isHungry: true,
happiness: 6
};
/*
You can access the values of each property using dot notation.
Log the name and breed of this dog using dot notation.
*/
let dogName = dog.name; // complete the code
let dogBreed = dog.breed; // complete the code
console.log(`${dogName} is a ${dogBreed}`);
/* EXPECTED RESULT
Spot is a Dalmatian
*/
54 changes: 27 additions & 27 deletions 1-exercises/A-accessing-values/exercise2.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
/*
You can also access the value of a property using bracket notation.
Bracket notation can be used when the property is stored as the value of a variable.
This can be very useful for iterating through an object's properties or when accessing a lookup table.
*/

let capitalCities = {
UnitedKingdom: "London",
China: "Beijing",
Peru: "Lima"
};

/*
You have an object, capitalCities, that contains key/value pairs of countries and their capital cities.
Log the value for the property assigned to the variable myCountry using bracket notation.
Do not use dot notation for this exercise!
*/

let myCountry = "UnitedKingdom";
let myCapitalCity; // complete the code

console.log(myCapitalCity);

/* EXPECTED RESULT

London

/*
You can also access the value of a property using bracket notation.
Bracket notation can be used when the property is stored as the value of a variable.
This can be very useful for iterating through an object's properties or when accessing a lookup table.
*/
let capitalCities = {
UnitedKingdom: "London",
China: "Beijing",
Peru: "Lima"
};
/*
You have an object, capitalCities, that contains key/value pairs of countries and their capital cities.
Log the value for the property assigned to the variable myCountry using bracket notation.
Do not use dot notation for this exercise!
*/
let myCountry = "UnitedKingdom";
let myCapitalCity = capitalCities[myCountry]; // complete the code
console.log(myCapitalCity);
/* EXPECTED RESULT
London
*/
65 changes: 34 additions & 31 deletions 1-exercises/A-accessing-values/exercise3.js
Original file line number Diff line number Diff line change
@@ -1,32 +1,35 @@
/*
An object's properties can have values that are other objects or arrays.
*/

let basketballTeam = {
name: "Chicago Bulls",
numberOfPlayers: 15,
topPlayers: ["Michael Jordan", "Scottie Pippen", "Dennis Rodman"],
homeStadium: {
name: "United Center",
capacity: 21000,
address: "1901 W Madison St",
},
};

/*
Write code that
- accesses the basketball team's top players array
- sorts the top players in alphabetical order
- console.logs the name of each player on a new line
*/

// write code here


/* EXPECTED RESULT

Dennis Rodman
Michael Jordan
Scottie Pippen

/*
An object's properties can have values that are other objects or arrays.
*/

let basketballTeam = {
name: "Chicago Bulls",
numberOfPlayers: 15,
topPlayers: ["Michael Jordan", "Scottie Pippen", "Dennis Rodman"],
homeStadium: {
name: "United Center",
capacity: 21000,
address: "1901 W Madison St",
},
};

/*
Write code that
- accesses the basketball team's top players array
- sorts the top players in alphabetical order
- console.logs the name of each player on a new line
*/
let topPlayers = basketballTeam.topPlayers.sort();
// console.log(topPlayers)
for (let players of topPlayers) {
console.log(players);
};// write code here


/* EXPECTED RESULT

Dennis Rodman
Michael Jordan
Scottie Pippen

*/
Loading