Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
9ea2443
At last done My homework
akadarAkku Oct 10, 2019
cce93b8
Update README.md
akadarAkku Oct 10, 2019
7a39454
Edited
akadarAkku Oct 11, 2019
5bb0d5b
Module-exercises done
akadarAkku Oct 12, 2019
233becb
I edited my code
akadarAkku Oct 12, 2019
5fdacd7
edited final
akadarAkku Oct 12, 2019
98f679c
Header width edited
akadarAkku Oct 12, 2019
948d45b
Edited three files
akadarAkku Oct 13, 2019
9b14d72
Edited repeat file
akadarAkku Oct 13, 2019
6e1e268
update
akadarAkku Oct 13, 2019
8fc5925
just start woring on Week 2 js
akadarAkku Oct 13, 2019
8ac0275
update
akadarAkku Oct 14, 2019
ab9d848
changed script folder
akadarAkku Oct 14, 2019
e45f705
Done My homework
akadarAkku Oct 17, 2019
96559a4
Update
akadarAkku Oct 18, 2019
b1231e2
Style edited
akadarAkku Oct 18, 2019
f40d191
All is Done
akadarAkku Oct 18, 2019
916752f
Updated with beautiful styles
akadarAkku Oct 18, 2019
b807edc
UPDATE
akadarAkku Oct 18, 2019
3a84870
Changed height of input
akadarAkku Oct 18, 2019
31cdc08
once again
akadarAkku Oct 18, 2019
995514a
Edited some style
akadarAkku Oct 18, 2019
aff6678
I changed style
akadarAkku Oct 19, 2019
c83570b
update with more style
akadarAkku Oct 19, 2019
1920c82
UPDATE
akadarAkku Oct 19, 2019
c24f4da
UPDATE
akadarAkku Oct 21, 2019
214d61b
update
akadarAkku Oct 21, 2019
38e5f63
edited
akadarAkku Oct 21, 2019
1d1b618
Changed week 3 JS files
akadarAkku Oct 22, 2019
e4a1c1c
update
akadarAkku Oct 22, 2019
4977be9
Encrypt & Decrypt are done
akadarAkku Oct 24, 2019
18f4afe
update repo
akadarAkku Oct 25, 2019
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
3 changes: 1 addition & 2 deletions module-exercises/errors-and-lifecycle.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,7 @@ function missingBeforeformal() {
evaluate(missingBeforeformal);

function unEscapedLineBreak() {
const a = 'this is
two lines';
const a = 'this is\n two lines';
}
evaluate(unEscapedLineBreak);

Expand Down
36 changes: 18 additions & 18 deletions module-exercises/explicit-coercion.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@
// fix the test cases' expected values to pass the function
const StringTests = [
// string values remain unchanged
{ name: 'str, any string', args: ['any string'], expected: null },
{ name: 'str, any string', args: ['any string'], expected: 'any string' },
// casting with String just puts quotes around a thing
{ name: 'num, 3', args: [3], expected: null },
{ name: 'boo, true', args: [true], expected: null },
{ name: 'obj, null', args: [null], expected: null },
{ name: 'und, undefined', args: [undefined], expected: null },
{ name: 'num, 3', args: [3], expected: '3' },
{ name: 'boo, true', args: [true], expected: 'true'},
{ name: 'obj, null', args: [null], expected: 'null' },
{ name: 'und, undefined', args: [undefined], expected: 'undefined'},
// write at least 5 more test cases for the String function
];
String.quizzing = true;
Expand All @@ -39,22 +39,22 @@ delete String.quizzing;
// fix the test cases' expected values to pass the function
const NumberTests = [
// numbers remain unchanged
{ name: 'num, 3', args: [3], expected: 3 },
{ name: 'num, 0', args: [0], expected: 0 },
{ name: 'num, 1e3', args: [1000], expected: 1e3 },
{ name: 'num, Infinity', args: [Infinity], expected: Infinity },
{ name: 'num, NaN', args: [NaN], expected: NaN },
{ name: 'num, 3', args: [3], expected: "NaN" },
{ name: 'num, 0', args: [0], expected: "0" },
{ name: 'num, 1e3', args: [1000], expected: "1000" },
{ name: 'num, Infinity', args: [Infinity], expected: Infinity},
{ name: 'num, NaN', args: [NaN], expected: "NaN"},
// true and false, the only boolean values
{ name: 'boo, true', args: [true], expected: 0 },
{ name: 'boo, false', args: [false], expected: 1 },
{ name: 'boo, true', args: [true], expected: "1" },
{ name: 'boo, false', args: [false], expected: "0" },
// null & undefined
{ name: 'obj, null', args: [null], expected: NaN },
{ name: 'und, undefined', args: [undefined], expected: 0 },
{ name: 'obj, null', args: [null], expected: "0" },
{ name: 'und, undefined', args: [undefined], expected: 'NaN' },
// strings are bit more interesting, write 7 more test cases with string args
{ name: 'str, undefined', args: ['undefined'], expected: NaN },
{ name: 'str, Infinity', args: ['Infinity'], expected: Infinity },
{ name: 'str, three', args: ['three'], expected: NaN },
{ name: 'str, 3', args: ['3'], expected: 3 },
{ name: 'str, undefined', args: ['undefined'], expected: "undefined"},
{ name: 'str, Infinity', args: ['Infinity'], expected: "Infinity"},
{ name: 'str, three', args: ['three'], expected: "three"},
{ name: 'str, 3', args: ['3'], expected: "3"},
];
Number.quizzing = true;
evaluate(Number, NumberTests);
Expand Down
104 changes: 52 additions & 52 deletions module-exercises/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,11 +174,11 @@ function tracing1() {
};

// set values in the args to pass the assert
let arg1 = "", arg2 = "", arg3 = "";
let arg1 = "y", arg2 = "x", arg3 = "z";
let returnval = f(arg1, arg2, arg3);
console.assert(returnval === "zyx", "1 a");

arg1 = "", arg2 = "", arg3 = "";
arg1 = "z", arg2 = "x", arg3 = "y";
returnval = f(arg1, arg2, arg3);
console.assert(returnval === "yzx", "1 b");

Expand All @@ -194,11 +194,11 @@ function tracing2() {
};

// set values in the args to pass the assert
let arg1 = "", arg2 = "", arg3 = "";
let arg1 = "x", arg2 = "y", arg3 = "z";
let returnVal = f(arg1, arg3, arg2);
console.assert(returnVal === "yxz", "returnVal should be yxz");

arg1 = "", arg2 = "", arg3 = "";
arg1 = "y", arg2 = "x", arg3 = "z";
returnVal = f(arg2, arg1, arg3);
console.log(returnVal === "zxy", "returnVal should be zxy");

Expand All @@ -217,12 +217,12 @@ function tracing3() {
};

// set values in the args to pass the assert
let arg1 = "", arg2 = "", arg3 = "";
let arg1 = "z", arg2 = "x", arg3 = "y";
let returnVal = f(arg1, arg2, arg3);
console.assert(returnVal === "yxz", "returnVal should be yxz");


arg1 = "", arg2 = "", arg3 = "";
arg1 = "z", arg2 = "y", arg3 = "x";
returnVal = f(arg3, arg2, arg1);
console.assert(returnVal === "zyx", "returnVal should be zyx");

Expand All @@ -239,11 +239,11 @@ function tracing4() {
// pass x, y and z to the function in the right order
// don't change their values!
let x = "x", y = "y", z = "z";
let returnVal = f();
let returnVal = f(x,z,y);
console.assert(returnVal === "yxz", "returnVal should be yxz");

x = "x", y = "z", z = "y";
returnVal = f();
returnVal = f(z,x,y);
console.assert(returnVal === "zyx", "returnVal should be zyx");

}
Expand All @@ -260,11 +260,11 @@ function tracing5() {
// pass x, y and z to the function in the right order
// don't change their values!
let x = "x", y = "y", z = "z";
let returnVal = f();
let returnVal = f(z,x,y);
console.assert(returnVal === "xzy", "returnVal should be xzy");

x = "y", y = "x", z = "z";
returnVal = f();
returnVal = f(x,z,y);
console.assert(returnVal === "zyx", "returnVal should be zyx");

}
Expand All @@ -275,7 +275,7 @@ function tracing6() {

// concatinate the params to pass the tests
function f(param1, param2, param3) {
const result = null;
const result = param3+param1+param2;
return result;
};

Expand All @@ -295,7 +295,7 @@ function tracing7() {

// concatinate the params to pass the tests
function f(param1, param2, param3) {
const result = null;
const result = param2+param3+param1;
return result;
};

Expand All @@ -314,16 +314,16 @@ evaluate(tracing7);
function tracing8() {

// arrange the parameters to pass the asserts
function f() {
function f(param1, param2, param3) {
var result = param2 + param1 + param3;
return result;
};

let arg1 = "z", arg2 = "y", arg3 = "x";
let arg1 = "x", arg2 = "y", arg3 = "z";
let returnVal = f(arg1, arg2, arg3);
console.assert(returnVal === "yxz", "returnVal should be yxz");

arg1 = "x", arg2 = "z", arg3 = "y";
arg1 = "x", arg2 = "y", arg3 = "z";
returnVal = f(arg3, arg1, arg2);
console.assert(returnVal === "xzy", "returnVal should be xzy");

Expand All @@ -334,16 +334,16 @@ evaluate(tracing8);
function tracing9() {

// arrange the parameters to pass the asserts
function f() {
function f(param1, param2, param3) {
var result = param1 + param2 + param3;
return result;
};

let arg1 = "y", arg2 = "z", arg3 = "x";
let arg1 = "x", arg2 = "y", arg3 = "z";
let returnVal = f(arg1, arg2, arg3);
console.assert(returnVal === "xyz", "returnVal should be xyz");

arg1 = "z", arg2 = "x", arg3 = "y";
arg1 = "y", arg2 = "z", arg3 = "x";
returnVal = f(arg3, arg1, arg2);
console.assert(returnVal === "xyz", "returnVal should be xyz");

Expand All @@ -354,21 +354,21 @@ evaluate(tracing9);
function tracing10() {

// do what needs to be done!
function f() { // <--
function f(param1, param2, param3,param4) { // <--
var result = param3 + param1 + param2 + param4;
return result;
};

let arg1 = "", arg2 = "", arg3 = "", arg4 = ""; // <--
let arg1 = "y", arg2 = "z", arg3 = "x", arg4 = "w"; // <--
let returnVal = f(arg1, arg2, arg3, arg4);
console.assert(returnVal === "xyzw", "returnVal should be xyzw");

arg1 = "z", arg2 = "w", arg3 = "y", arg4 = "x";
returnVal = f(arg3, arg1, arg4, arg2);
console.assert(returnVal === "", "returnVal should be ?"); // <--
console.assert(returnVal === "xyzw", "returnVal should be xyzw"); // <--

arg1 = "z", arg2 = "w", arg3 = "y", arg4 = "x";
returnVal = f(); // <--
returnVal = f(arg3, arg2, arg1, arg4); // <--
console.assert(returnVal === "zywx", "returnVal should be zywx");

}
Expand Down Expand Up @@ -431,12 +431,12 @@ evaluate(example2_testCases, exampleTestCases);


const writeTestCases1 = [
{ name: 'first', args: [/* what adds to be 5? */], expected: 5 },
{ name: 'second', args: [/* what else adds to be 5? */], expected: 5 },
{ name: 'third', args: [-2, 2], expected: null }, // what return value do you expect?
{ name: 'fourth', args: [100, 20], expected: null }, // what return value do you expect?
{ name: 'fifth', args: [], expected: null }, // create your own test case!
{ name: 'sixth', args: [], expected: null }, // create your own test case!
{ name: 'first', args: [1,4], expected: 5 },
{ name: 'second', args: [2,3], expected: 5 },
{ name: 'third', args: [-2, 2], expected: 0 }, // what return value do you expect?
{ name: 'fourth', args: [100, 20], expected: 120 }, // what return value do you expect?
{ name: 'fifth', args: [3,5], expected: 8 }, // create your own test case!
{ name: 'sixth', args: [4,6], expected: 10 }, // create your own test case!
];
function functionToTest1(a, b) {
const result = a + b;
Expand All @@ -445,12 +445,12 @@ function functionToTest1(a, b) {
evaluate(functionToTest1, writeTestCases1);

const writeTestCases2 = [
{ name: 'first', args: [/* what subtracts to be 5? */], expected: 5 },
{ name: 'second', args: [/* what else subtracts to be 5? */], expected: 5 },
{ name: 'third', args: [10, 2], expected: null }, // what return value do you expect?
{ name: 'fourth', args: [10, 20], expected: null }, // what return value do you expect?
{ name: 'fifth', args: [], expected: null }, // create your own test case!
{ name: 'sixth', args: [], expected: null }, // create your own test case!
{ name: 'first', args: [6,1], expected: 5 },
{ name: 'second', args: [7,2], expected: 5 },
{ name: 'third', args: [10, 2], expected: 8 }, // what return value do you expect?
{ name: 'fourth', args: [10, 20], expected: -10 }, // what return value do you expect?
{ name: 'fifth', args: [2,1], expected: 1 }, // create your own test case!
{ name: 'sixth', args: [3,1], expected: 2 }, // create your own test case!
];
function functionToTest2(a, b) {
const result = a - b;
Expand All @@ -461,12 +461,12 @@ evaluate(functionToTest2, writeTestCases2);


const writeTestCases3 = [
{ name: 'first', args: [/* what multiplies to be 5? */], expected: 5 },
{ name: 'second', args: [/* what else multiplies to be 5? */], expected: 5 },
{ name: 'third', args: [10, 2], expected: null }, // what return value do you expect?
{ name: 'fourth', args: [10, 20], expected: null }, // what return value do you expect?
{ name: 'fifth', args: [], expected: null }, // create your own test case!
{ name: 'sixth', args: [], expected: null }, // create your own test case!
{ name: 'first', args: [5,1], expected: 5 },
{ name: 'second', args: [1,5], expected: 5 },
{ name: 'third', args: [10, 2], expected: 20 }, // what return value do you expect?
{ name: 'fourth', args: [10, 20], expected: 200 }, // what return value do you expect?
{ name: 'fifth', args: [1,2], expected: 2 }, // create your own test case!
{ name: 'sixth', args: [1,3], expected: 3 }, // create your own test case!
];
function functionToTest3(a, b) {
const result = a * b;
Expand All @@ -477,12 +477,12 @@ evaluate(functionToTest3, writeTestCases3);


const writeTestCases4 = [
{ name: 'first', args: [/* what letters in what order will return "zyx"? */], expected: 'zyx' },
{ name: 'second', args: [/* what letters in what order will return "yzx"? */], expected: 'yzx' },
{ name: 'third', args: ['y', 'z', 'x'], expected: null }, // what return value do you expect?
{ name: 'fourth', args: ['x', 'y', 'z'], expected: null }, // what return value do you expect?
{ name: 'fifth', args: [], expected: null }, // create your own test case!
{ name: 'sixth', args: [], expected: null }, // create your own test case!
{ name: 'first', args: ['y','x','z'], expected: 'zyx' },
{ name: 'second', args: ['z','x','y'], expected: 'yzx' },
{ name: 'third', args: ['y', 'z', 'x'], expected: 'xyz' }, // what return value do you expect?
{ name: 'fourth', args: ['x', 'y', 'z'], expected: 'zxy' }, // what return value do you expect?
{ name: 'fifth', args: ['y','x','z'], expected: 'zyx' }, // create your own test case!
{ name: 'sixth', args: ['x','z','y'], expected: 'yxz' }, // create your own test case!
];
function functionToTest4(a, b, c) {
const result = c + a + b;
Expand All @@ -493,12 +493,12 @@ evaluate(functionToTest4, writeTestCases4);


const writeTestCases5 = [
{ name: 'first', args: [/* what letters in what order will return "zyx"? */], expected: 'zyx' },
{ name: 'second', args: [/* what letters in what order will return "yzx"? */], expected: 'yzx' },
{ name: 'third', args: ['y', 'z', 'x'], expected: null }, // what return value do you expect?
{ name: 'fourth', args: ['x', 'y', 'z'], expected: null }, // what return value do you expect?
{ name: 'fifth', args: [], expected: null }, // create your own test case!
{ name: 'sixth', args: [], expected: null }, // create your own test case!
{ name: 'first', args: ['x', 'z', 'y'], expected: 'zyx' },
{ name: 'second', args: ['x', 'y', 'z'], expected: 'yzx' },
{ name: 'third', args: ['y', 'z', 'x'], expected: 'zxy'}, // what return value do you expect?
{ name: 'fourth', args: ['x', 'y', 'z'], expected:'yzx' }, // what return value do you expect?
{ name: 'fifth', args: ['z', 'y', 'x'], expected: 'yxz' }, // create your own test case!
{ name: 'sixth', args:['z', 'x', 'y'], expected: 'xyz' }, // create your own test case!
];
function functionToTest5(a, b, c) {
const result = b + c + a;
Expand Down
4 changes: 2 additions & 2 deletions module-exercises/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<script src="functions.js"></script>
<script src="primitive-types.js"></script>
<script src="explicit-coercion.js"></script>
<script src="truthiness.js"></script>
<!--<script src="truthiness.js"></script>
<script src="truthiness-operators.js"></script>
<script src="primitive-operators.js"></script>
<script src="arrays.js"></script>
Expand All @@ -35,7 +35,7 @@
<script src="statements-vs-expressions.js"></script>
<script src="loops.js"></script>
<script src="for-in-for-of.js"></script>
<script src="errors-and-lifecycle.js"></script>
<script src="errors-and-lifecycle.js"></script>-->


<a href="./challenges/index.html">challenge exercises</a>
Expand Down
Loading