-
What would be the answer: true or false?
console.log("3" === 3);
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
let counter = 0; | |
let scope = undefined; | |
const scopeof = new WeakMap(); | |
const callstack = []; | |
const stack = []; | |
let studentCode = ""; | |
let transitions = []; | |
let states = []; |
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
'use strict'; | |
window.addEventListener('DOMContentLoaded', () => { | |
const assert = (assertion, message) => { | |
if (assertion) { | |
console.log('%cPASS: ', 'color: green;', message); | |
} else { | |
console.log('%cFAIL: ', 'color: red;', message); | |
} | |
}; |
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
'use strict'; | |
/* generate mp4's of the screenshare + audio from a BBB hosted recording | |
$ node this-file.js meeting-id name-of-output-file keep | |
- meeting-id (required) a big blue button meeting id, you can find this in the URL for recorded sessions. | |
the script will exit early if this is not provided | |
- name-of-output-file (optional) the output file name should not include an extension, just the name. | |
defaults to class-recording.mp4 |
In this module you will explore different ways to break down and solve coding challenges. Along with structured workflows for approaching challenges, you will learn the JavaScript you need to write clear and maintainable solutions including: reading and writing tests, higher order functions, arrays and object.
What does the function do? What are it’s arguments and it’s return value? How could you use it in a program? Behavior is all about what your function looks like "from the outside", without caring about what is written inside.
Functions behavior is generally described using use cases, documentation and/or unit tests:
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
/* | |
this script uses ../index.json to run & evaluate each .js file in /exercises | |
after the review is finished it writes a README for each folder of exercises in /review | |
*/ | |
// require dependencies (native node modules) | |
const path = require('path'); | |
const fs = require('fs'); | |
// require evaluation & reporting scripts (non-native, stored in /lib) |
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
const fs = require("fs"); | |
const path = require("path"); | |
const config = require("../config.json"); | |
const EXERCISES_DIR = path.normalize(path.join(__dirname, '..', config.path)); | |
const EXAMPLE_WORDS = ['example', 'examples', 'worked', 'stepped', 'demo']; | |
const PARENT_DIR = path.normalize(path.join(__dirname, '..')); | |
try { | |
fs.accessSync(EXERCISES_DIR); |
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
/* | |
this file opens a server that can only send files after reading them directly from the file system | |
files are accessed by trying to find a file path matching the url path exactly | |
it keeps a log of each request/response cycle in /server-logs | |
*/ | |
// require other people's code to use it in this script | |
// these dependencies all come pre-installed with node | |
const http = require('http'); | |
const fs = require('fs'); |
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
// require dependencies | |
const fs = require('fs'); | |
const path = require('path'); | |
const nodeFetch = require('node-fetch'); | |
const assert = require('assert'); | |
// declare constants | |
const START = Date.now(); | |
const NOW = () => `${Date.now() - START} ms: `; | |
const REPORT_NAME = path.basename(__filename).replace('.js', '-report.txt'); |
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
const cowsay = require('cowsay'); | |
const fs = require('fs'); | |
const COWSAID_DIRNAME = 'cowsaid'; | |
const DOC_STRING = `CONFG OPTIONS | |
text:"lorem ipsum" -- what the cow should say | |
default -- I cow hard | |
e:"oo" -- the cow's eyes. | |
not all cowfiles have customizable eyes | |
2 characters only is recommended |