Skip to content
This repository was archived by the owner on Dec 18, 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
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

300 changes: 297 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "Module-JS2",
"name": "module-js2",
"version": "1.0.0",
"license": "CC-BY-SA-4.0",
"description": "You must update this package",
Expand All @@ -18,12 +18,306 @@
"@testing-library/dom": "^8.19.0",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/user-event": "^13.5.0",
"jest": "^29.2.2",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.2.2"
},
"jest": {
"setupFilesAfterEnv": [
"./jest.setup.js"
]
}
},
"main": "jest.setup.js",
"dependencies": {
"abab": "^2.0.6",
"acorn": "^8.10.0",
"acorn-globals": "^7.0.1",
"acorn-walk": "^8.2.0",
"agent-base": "^6.0.2",
"ansi-escapes": "^4.3.2",
"ansi-regex": "^5.0.1",
"ansi-styles": "^4.3.0",
"anymatch": "^3.1.3",
"argparse": "^1.0.10",
"aria-query": "^5.1.3",
"array-buffer-byte-length": "^1.0.0",
"asynckit": "^0.4.0",
"available-typed-arrays": "^1.0.5",
"babel-jest": "^29.7.0",
"babel-plugin-istanbul": "^6.1.1",
"babel-plugin-jest-hoist": "^29.6.3",
"babel-preset-current-node-syntax": "^1.0.1",
"babel-preset-jest": "^29.6.3",
"balanced-match": "^1.0.2",
"brace-expansion": "^1.1.11",
"braces": "^3.0.2",
"browserslist": "^4.22.1",
"bser": "^2.1.1",
"buffer-from": "^1.1.2",
"call-bind": "^1.0.2",
"callsites": "^3.1.0",
"camelcase": "^5.3.1",
"caniuse-lite": "^1.0.30001547",
"chalk": "^4.1.2",
"char-regex": "^1.0.2",
"ci-info": "^3.9.0",
"cjs-module-lexer": "^1.2.3",
"cliui": "^8.0.1",
"co": "^4.6.0",
"collect-v8-coverage": "^1.0.2",
"color-convert": "^2.0.1",
"color-name": "^1.1.4",
"combined-stream": "^1.0.8",
"concat-map": "^0.0.1",
"convert-source-map": "^2.0.0",
"create-jest": "^29.7.0",
"cross-spawn": "^7.0.3",
"css.escape": "^1.5.1",
"cssom": "^0.5.0",
"cssstyle": "^2.3.0",
"data-urls": "^3.0.2",
"debug": "^4.3.4",
"decimal.js": "^10.4.3",
"dedent": "^1.5.1",
"deep-equal": "^2.2.2",
"deepmerge": "^4.3.1",
"define-data-property": "^1.1.0",
"define-properties": "^1.2.1",
"delayed-stream": "^1.0.0",
"detect-newline": "^3.1.0",
"diff-sequences": "^29.6.3",
"dom-accessibility-api": "^0.5.16",
"domexception": "^4.0.0",
"electron-to-chromium": "^1.4.551",
"emittery": "^0.13.1",
"emoji-regex": "^8.0.0",
"entities": "^4.5.0",
"error-ex": "^1.3.2",
"es-get-iterator": "^1.1.3",
"escalade": "^3.1.1",
"escape-string-regexp": "^2.0.0",
"escodegen": "^2.1.0",
"esprima": "^4.0.1",
"estraverse": "^5.3.0",
"esutils": "^2.0.3",
"execa": "^5.1.1",
"exit": "^0.1.2",
"expect": "^29.7.0",
"fast-json-stable-stringify": "^2.1.0",
"fb-watchman": "^2.0.2",
"fill-range": "^7.0.1",
"find-up": "^4.1.0",
"for-each": "^0.3.3",
"form-data": "^4.0.0",
"fs.realpath": "^1.0.0",
"function-bind": "^1.1.1",
"functions-have-names": "^1.2.3",
"gensync": "^1.0.0-beta.2",
"get-caller-file": "^2.0.5",
"get-intrinsic": "^1.2.1",
"get-package-type": "^0.1.0",
"get-stream": "^6.0.1",
"glob": "^7.2.3",
"globals": "^11.12.0",
"gopd": "^1.0.1",
"graceful-fs": "^4.2.11",
"has": "^1.0.4",
"has-bigints": "^1.0.2",
"has-flag": "^4.0.0",
"has-property-descriptors": "^1.0.0",
"has-proto": "^1.0.1",
"has-symbols": "^1.0.3",
"has-tostringtag": "^1.0.0",
"html-encoding-sniffer": "^3.0.0",
"html-escaper": "^2.0.2",
"http-proxy-agent": "^5.0.0",
"https-proxy-agent": "^5.0.1",
"human-signals": "^2.1.0",
"iconv-lite": "^0.6.3",
"import-local": "^3.1.0",
"imurmurhash": "^0.1.4",
"indent-string": "^4.0.0",
"inflight": "^1.0.6",
"inherits": "^2.0.4",
"internal-slot": "^1.0.5",
"is-arguments": "^1.1.1",
"is-array-buffer": "^3.0.2",
"is-arrayish": "^0.2.1",
"is-bigint": "^1.0.4",
"is-boolean-object": "^1.1.2",
"is-callable": "^1.2.7",
"is-core-module": "^2.13.0",
"is-date-object": "^1.0.5",
"is-fullwidth-code-point": "^3.0.0",
"is-generator-fn": "^2.1.0",
"is-map": "^2.0.2",
"is-number": "^7.0.0",
"is-number-object": "^1.0.7",
"is-potential-custom-element-name": "^1.0.1",
"is-regex": "^1.1.4",
"is-set": "^2.0.2",
"is-shared-array-buffer": "^1.0.2",
"is-stream": "^2.0.1",
"is-string": "^1.0.7",
"is-symbol": "^1.0.4",
"is-typed-array": "^1.1.12",
"is-weakmap": "^2.0.1",
"is-weakset": "^2.0.2",
"isarray": "^2.0.5",
"isexe": "^2.0.0",
"istanbul-lib-coverage": "^3.2.0",
"istanbul-lib-instrument": "^6.0.1",
"istanbul-lib-report": "^3.0.1",
"istanbul-lib-source-maps": "^4.0.1",
"istanbul-reports": "^3.1.6",
"jest-changed-files": "^29.7.0",
"jest-circus": "^29.7.0",
"jest-cli": "^29.7.0",
"jest-config": "^29.7.0",
"jest-diff": "^29.7.0",
"jest-docblock": "^29.7.0",
"jest-each": "^29.7.0",
"jest-environment-node": "^29.7.0",
"jest-get-type": "^29.6.3",
"jest-haste-map": "^29.7.0",
"jest-leak-detector": "^29.7.0",
"jest-matcher-utils": "^29.7.0",
"jest-message-util": "^29.7.0",
"jest-mock": "^29.7.0",
"jest-pnp-resolver": "^1.2.3",
"jest-regex-util": "^29.6.3",
"jest-resolve": "^29.7.0",
"jest-resolve-dependencies": "^29.7.0",
"jest-runner": "^29.7.0",
"jest-runtime": "^29.7.0",
"jest-snapshot": "^29.7.0",
"jest-util": "^29.7.0",
"jest-validate": "^29.7.0",
"jest-watcher": "^29.7.0",
"jest-worker": "^29.7.0",
"js-tokens": "^4.0.0",
"js-yaml": "^3.14.1",
"jsdom": "^20.0.3",
"jsesc": "^2.5.2",
"json-parse-even-better-errors": "^2.3.1",
"json5": "^2.2.3",
"kleur": "^3.0.3",
"leven": "^3.1.0",
"lines-and-columns": "^1.2.4",
"locate-path": "^5.0.0",
"lodash": "^4.17.21",
"lru-cache": "^5.1.1",
"lz-string": "^1.5.0",
"make-dir": "^4.0.0",
"makeerror": "^1.0.12",
"merge-stream": "^2.0.0",
"micromatch": "^4.0.5",
"mime-db": "^1.52.0",
"mime-types": "^2.1.35",
"mimic-fn": "^2.1.0",
"min-indent": "^1.0.1",
"minimatch": "^3.1.2",
"ms": "^2.1.2",
"natural-compare": "^1.4.0",
"node-int64": "^0.4.0",
"node-releases": "^2.0.13",
"normalize-path": "^3.0.0",
"npm-run-path": "^4.0.1",
"nwsapi": "^2.2.7",
"object-inspect": "^1.12.3",
"object-is": "^1.1.5",
"object-keys": "^1.1.1",
"object.assign": "^4.1.4",
"once": "^1.4.0",
"onetime": "^5.1.2",
"p-limit": "^3.1.0",
"p-locate": "^4.1.0",
"p-try": "^2.2.0",
"parse-json": "^5.2.0",
"parse5": "^7.1.2",
"path-exists": "^4.0.0",
"path-is-absolute": "^1.0.1",
"path-key": "^3.1.1",
"path-parse": "^1.0.7",
"picocolors": "^1.0.0",
"picomatch": "^2.3.1",
"pirates": "^4.0.6",
"pkg-dir": "^4.2.0",
"pretty-format": "^27.5.1",
"prompts": "^2.4.2",
"psl": "^1.9.0",
"punycode": "^2.3.0",
"pure-rand": "^6.0.4",
"querystringify": "^2.2.0",
"react-is": "^17.0.2",
"redent": "^3.0.0",
"regenerator-runtime": "^0.14.0",
"regexp.prototype.flags": "^1.5.1",
"require-directory": "^2.1.1",
"requires-port": "^1.0.0",
"resolve": "^1.22.8",
"resolve-cwd": "^3.0.0",
"resolve-from": "^5.0.0",
"resolve.exports": "^2.0.2",
"safer-buffer": "^2.1.2",
"saxes": "^6.0.0",
"semver": "^6.3.1",
"set-function-name": "^2.0.1",
"shebang-command": "^2.0.0",
"shebang-regex": "^3.0.0",
"side-channel": "^1.0.4",
"signal-exit": "^3.0.7",
"sisteransi": "^1.0.5",
"slash": "^3.0.0",
"source-map": "^0.6.1",
"source-map-support": "^0.5.13",
"sprintf-js": "^1.0.3",
"stack-utils": "^2.0.6",
"stop-iteration-iterator": "^1.0.0",
"string-length": "^4.0.2",
"string-width": "^4.2.3",
"strip-ansi": "^6.0.1",
"strip-bom": "^4.0.0",
"strip-final-newline": "^2.0.0",
"strip-indent": "^3.0.0",
"strip-json-comments": "^3.1.1",
"supports-color": "^7.2.0",
"supports-preserve-symlinks-flag": "^1.0.0",
"symbol-tree": "^3.2.4",
"test-exclude": "^6.0.0",
"tmpl": "^1.0.5",
"to-fast-properties": "^2.0.0",
"to-regex-range": "^5.0.1",
"tough-cookie": "^4.1.3",
"tr46": "^3.0.0",
"type-detect": "^4.0.8",
"type-fest": "^0.21.3",
"undici-types": "^5.25.3",
"universalify": "^0.2.0",
"update-browserslist-db": "^1.0.13",
"url-parse": "^1.5.10",
"v8-to-istanbul": "^9.1.3",
"w3c-xmlserializer": "^4.0.0",
"walker": "^1.0.8",
"webidl-conversions": "^7.0.0",
"whatwg-encoding": "^2.0.0",
"whatwg-mimetype": "^3.0.0",
"whatwg-url": "^11.0.0",
"which": "^2.0.2",
"which-boxed-primitive": "^1.0.2",
"which-collection": "^1.0.1",
"which-typed-array": "^1.1.11",
"wrap-ansi": "^7.0.0",
"wrappy": "^1.0.2",
"write-file-atomic": "^4.0.2",
"ws": "^8.14.2",
"xml-name-validator": "^4.0.0",
"xmlchars": "^2.2.0",
"y18n": "^5.0.8",
"yallist": "^3.1.1",
"yargs": "^17.7.2",
"yargs-parser": "^21.1.1",
"yocto-queue": "^0.1.0"
},
"keywords": [],
"author": ""
}
5 changes: 3 additions & 2 deletions week-2/debug/address.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Predict and explain first...
//It won't print because the code is an object and indexing doesn't work for an object unlike an array.

// This code should log out the houseNumber from the address object
// but it isn't working...
Expand All @@ -9,7 +10,7 @@ const address = {
street: "Imaginary Road",
city: "Manchester",
country: "England",
postcode: "XYZ 123",
postcode: "XYZ 123"
};

console.log(`My house number is ${address[0]}`);
console.log(`My house number is ${address.houseNumber}.`);
8 changes: 4 additions & 4 deletions week-2/debug/author.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
// Predict and explain first...
//Answer: The console would not print because "of" can't iterate through in for of "in" will and the dot won't work as well except if square brackets is used.

// This program attempts to log out all the property values in the object.
// But it isn't working. Explain why first and then fix the problem

const author = {
firstName: "Zadie",
lastName: "Smith",
occupation: "writer",
occupation: "Writer",
age: 40,
alive: true,
};

for (const value of author) {
console.log(value);
for (const value in author) {
console.log(author[value]);
}
8 changes: 6 additions & 2 deletions week-2/debug/recipe.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Predict and explain first...
//The ingredients will not print because it sees it as an object

// This program should log out the title, how many it serves and the ingredients.
// Each ingredient should be logged on a new line
Expand All @@ -11,5 +12,8 @@ const recipe = {
};

console.log(`${recipe.title} serves ${recipe.serves}
ingredients:
${recipe}`);
ingredients:
${recipe.ingredients[0]}
${recipe.ingredients[1]}
${recipe.ingredients[2]}
${recipe.ingredients[3]}`);
Loading