diff --git a/.DS_Store b/.DS_Store
new file mode 100644
index 0000000..00d476c
Binary files /dev/null and b/.DS_Store differ
diff --git a/module-exercises/arrays.js b/module-exercises/arrays.js
index baf3f53..617a906 100644
--- a/module-exercises/arrays.js
+++ b/module-exercises/arrays.js
@@ -102,23 +102,39 @@ evaluate(example_garbageCollectingArrays);
function passTheAssertions1() {
; // declare and assign a1
+ let a1 = [];
; // declare and assign a2
+ let a2 = a1;
+
console.assert(a1 === a2, 'a1 should strictly equal a2');
+
; // declare and assign b1
+ let b1 = [];
; // declare and assign b2
- console.assert(b1 !== b2, 'b1 should not strictly equal b2');
+ let b2 = [];
+
+ console.assert(b1 !== b2, 'b1 should not strictly equal b2');
+
// ---
; // write one line to pass the assertions
+ a1 = a2 = ['hi!'];
+
console.assert(a1[0] === a2[0], 'a1[0] should strictly equal a2[0]');
console.assert(a1[0] === 'hi!', 'a1.x should strictly equal "hi!"');
+
+
; // write two lines to pass the assertions
- ;
+
+ b1 = ['bye!'];
+ b2 = b1;
console.assert(b1[0] === b2[0], 'b1[0] should strictly equal b2[0]');
console.assert(b1[0] === 'bye!', 'b1.x should strictly equal "bye!"');
+
+
}
evaluate(passTheAssertions1);
@@ -128,24 +144,38 @@ function passTheAssertions2() {
let reference1 = [];
; // write this line
+
+ let value2 = value1;
+
console.assert(value2 === value1, "value1 should strictly equal value2");
; // write this line
+
+ let reference2 = reference1;
+
console.assert(reference2 === reference1, "reference1 should strictly equal reference2");
- value2 = value2 + 1; // write this line
+ value2 = value2 + 1; value1 = '___';
+
+
console.assert(value1 !== null, "value1 should strictly equal ___");
; // write this line
+ referans1[0] = reference2[0];
+ reference1 [0] = ['hi!'];
+ console.log(reference2);
+
console.assert(reference1[0] === reference2[0], "references[0] should be strictly equal");
console.assert(reference1[0] === 'hi!', "reference1[0] should be strictly equal to 'hi!'");
; // write this line
+ reference1 = reference2;
+
console.assert(reference1 === reference2, "references should be strictly equal");
// remove the array from memory
- ; // write this line
- ; // write this line
+ ; reference1 = null;
+ ; reference2 = null;
}
evaluate(passTheAssertions2);
@@ -153,6 +183,12 @@ evaluate(passTheAssertions2);
function passTheAssertions3() {
; // write this line
; // write this line
+arr1 = [];
+arr2 = [];
+arr1[1] = arr2[1];
+arr[1] = ['B']
+
+
console.assert(arr1 !== arr2, 'the variables should not be strictly equal');
console.assert(arr1[1] === arr2[1], 'their first entries should be the same');
console.assert(arr1[1] === 'B', 'arr1[1]] should be "B"');
@@ -163,10 +199,15 @@ function passTheAssertions3() {
; // write this line
; // write this line
+ arr1[arr2[2]] = ['B'];
+ arr1[arr2[2]] = arr2[arr1[2]];
+
console.assert(arr1[arr2[2]] === 'B', 'arr2[2] should be "B"s index in arr1');
console.assert(arr1[arr2[2]] === arr2[arr1[2]], 'some tricky nested thing should be true');
; // write this line
+
+
console.assert(arr1 !== arr2, 'arr1 should strictly equal arr2');
console.assert(arr3 !== arr1, 'arr3 should not strictly equal arr`');
console.assert(arr3 === arr2, 'arr3 should strictly equal arr2');
diff --git a/module-exercises/explicit-coercion.js b/module-exercises/explicit-coercion.js
index d6bcfd4..20b2db0 100644
--- a/module-exercises/explicit-coercion.js
+++ b/module-exercises/explicit-coercion.js
@@ -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;
@@ -45,11 +45,11 @@ const NumberTests = [
{ 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 },
@@ -68,19 +68,19 @@ const BooleanTests = [
{ name: 'boo, false', args: [false], expected: false },
// anything but 0 & NaN is cast to true
{ name: 'num, 3', args: [3], expected: true },
- { name: 'num, 0', args: [0], expected: true },
+ { name: 'num, 0', args: [0], expected: false },
{ name: 'num, 1e3', args: [1000], expected: true },
- { name: 'num, Infinity', args: [Infinity], expected: false },
+ { name: 'num, Infinity', args: [Infinity], expected: true },
{ name: 'num, NaN', args: [NaN], expected: false },
// null & undefined
- { name: 'obj, null', args: [null], expected: true },
- { name: 'und, undefined', args: [undefined], expected: true },
+ { name: 'obj, null', args: [null], expected: false },
+ { name: 'und, undefined', args: [undefined], expected: false },
// anything but an empty string is cast to true
- { name: 'str, undefined', args: ['undefined'], expected: false },
- { name: 'str, false', args: ['false'], expected: false },
+ { name: 'str, undefined', args: ['undefined'], expected: true },
+ { name: 'str, false', args: ['false'], expected: true },
{ name: 'str, Infinity', args: ['Infinity'], expected: true },
{ name: 'str, three', args: ['three'], expected: true },
- { name: 'str, ', args: [''], expected: true },
+ { name: 'str, ', args: [''], expected: false },
{ name: 'str, 3', args: ['3'], expected: true },
];
Boolean.quizzing = true;
diff --git a/module-exercises/functions.js b/module-exercises/functions.js
index f22570a..b573bd4 100644
--- a/module-exercises/functions.js
+++ b/module-exercises/functions.js
@@ -174,14 +174,15 @@ 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");
+
}
evaluate(tracing1);
@@ -194,11 +195,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");
@@ -217,12 +218,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");
@@ -239,11 +240,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");
}
@@ -260,11 +261,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");
}
@@ -275,7 +276,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;
};
@@ -295,7 +296,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;
};
@@ -314,7 +315,7 @@ evaluate(tracing7);
function tracing8() {
// arrange the parameters to pass the asserts
- function f() {
+ function f(param3,param2,param1) {
var result = param2 + param1 + param3;
return result;
};
@@ -334,7 +335,7 @@ evaluate(tracing8);
function tracing9() {
// arrange the parameters to pass the asserts
- function f() {
+ function f(param2,param3,param1) {
var result = param1 + param2 + param3;
return result;
};
@@ -354,21 +355,21 @@ evaluate(tracing9);
function tracing10() {
// do what needs to be done!
- function f() { // <--
+function f(param3,param1,param2,param4) { // <--
var result = param3 + param1 + param2 + param4;
return result;
};
- let arg1 = "", arg2 = "", arg3 = "", arg4 = ""; // <--
+ let arg1 = "x", arg2 = "y", arg3 = "z", 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 === "yzxw", "returnVal should be ?"); // <--
arg1 = "z", arg2 = "w", arg3 = "y", arg4 = "x";
- returnVal = f(); // <--
+ returnVal = f(arg1,arg3,arg2,arg4); // <--
console.assert(returnVal === "zywx", "returnVal should be zywx");
}
@@ -431,12 +432,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: [0,5], 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: [5,10], expected: 15}, // create your own test case!
+ { name: 'sixth', args: [-10,20], expected: 10 }, // create your own test case!
];
function functionToTest1(a, b) {
const result = a + b;
@@ -445,12 +446,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: [/* what subtracts to be 5? */6,1], expected: 5 },
+ { name: 'second', args: [/* what else subtracts to be 5? */8,3], 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: [100,30], expected: 70 }, // create your own test case!
+ { name: 'sixth', args: [4,2], expected: 2 }, // create your own test case!
];
function functionToTest2(a, b) {
const result = a - b;
@@ -461,12 +462,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: [/* what multiplies to be 5? */1,5], expected: 5 },
+ { name: 'second', args: [/* what else multiplies to be 5? */5,1], 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: [4,5], expected: 20 }, // create your own test case!
+ { name: 'sixth', args: [3,7], expected: 21 }, // create your own test case!
];
function functionToTest3(a, b) {
const result = a * b;
@@ -477,12 +478,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: [/* what letters in what order will return "zyx"? */'y','x','z'], expected: 'zyx' },
+ { name: 'second', args: [/* what letters in what order will return "yzx"? */'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: ['z','y','x'], expected: 'xzy' }, // 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;
@@ -493,12 +494,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: [/* what letters in what order will return "zyx"? */'x','z','y'], expected: 'zyx' },
+ { name: 'second', args: [/* what letters in what order will return "yzx"? */'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: ['y','x','z'], expected: 'xzy' }, // create your own test case!
];
function functionToTest5(a, b, c) {
const result = b + c + a;
diff --git a/module-exercises/index.html b/module-exercises/index.html
index 2ef651b..b622a93 100644
--- a/module-exercises/index.html
+++ b/module-exercises/index.html
@@ -1,45 +1,42 @@
-
+
+
+
-
-
+ understand javascript
+
- understand javascript
-
+
+
-
-
+
+ how to work with these exercises
-
-
- how to work with these exercises
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- challenge exercises
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ challenge exercises
+
diff --git a/module-exercises/loops.js b/module-exercises/loops.js
index 0d67c58..99e9079 100644
--- a/module-exercises/loops.js
+++ b/module-exercises/loops.js
@@ -103,12 +103,14 @@ function loopRefactor1() {
while (i !== 8) {
whileResult += i;
i += 2;
+
}
// fix the three pieces of this for loop to pass the assert
let forResult = 0;
- for (null; null; null) {
+ for (let i=0; i!==8; i+=2) {
forResult += i;
+
}
console.assert(forResult === whileResult, 'both loops should have the same behavior');
@@ -127,10 +129,10 @@ function loopRefactor2() {
// fix the three pieces of this for loop to pass the assert
let whileResult = 0;
- null;
- while (null) {
+ i=5;
+ while (i>-2) {
whileResult = whileResult + i;
- null;
+ i--;
}
console.assert(forResult === whileResult, 'both loops should have the same behavior');
diff --git a/module-exercises/primitive-operators.js b/module-exercises/primitive-operators.js
index 53ad3c0..0ccfcfc 100644
--- a/module-exercises/primitive-operators.js
+++ b/module-exercises/primitive-operators.js
@@ -35,16 +35,16 @@ const plusTests = [
{ name: 'number, boolean', args: [1, true], expected: 2 },
{ name: 'number, null', args: [1, null], expected: 1 },
{ name: 'number, undefined', args: [1, undefined], expected: NaN },
- { name: 'NaN, anything else', args: [NaN, 'anything else!'], expected: NaN },
+ { name: 'NaN, "anything else"', args: [NaN, "anything else"], expected: 'NaNanything else'}, //the test code was shown in orange color, that is why I had to change it
// fill in the rest of these test cases
- { name: null, args: null, expected: null },
- { name: null, args: null, expected: null },
- { name: null, args: null, expected: null },
- { name: null, args: null, expected: null },
- { name: null, args: null, expected: null },
- { name: null, args: null, expected: null },
- { name: null, args: null, expected: null },
- { name: null, args: null, expected: null },
+ { name: 'string,number', args: ['akbel',29], expected: 'akbel29' },
+ { name: 'string, NaN', args: ['name',NaN], expected: 'nameNaN' },
+ { name: 'number,boolean', args: [30,false], expected: 30},
+ { name: 'boolean,boolean', args: [true,false], expected: 1},
+ { name: 'null,boolean', args: [null,true], expected: 1},
+ { name: 'NaN,number', args: [NaN,20], expected: NaN },
+ { name: 'undefined,number', args: [undefined,20], expected: NaN },
+ { name: 'null,null', args: [null,null], expected: 0 },
];
function plus(a, b) {
return a + b;
diff --git a/module-exercises/primitive-types.js b/module-exercises/primitive-types.js
index 2ab5eb0..75da40b 100644
--- a/module-exercises/primitive-types.js
+++ b/module-exercises/primitive-types.js
@@ -59,27 +59,27 @@ evaluate(example_allValuesHaveAType);
// the type of a value is very important to understanding how JS works
const typeofTests = [
// boolean values
- { name: 'boo, true', args: [true], expected: '' },
- { name: 'boo, false', args: [false], expected: '' },
+ { name: 'boo, true', args: [true], expected: 'boolean' },
+ { name: 'boo, false', args: [false], expected: 'boolean' },
// null's type is 'null'. just remember, don't try yet to understand
- { name: 'obj, true', args: [null], expected: '' },
+ { name: 'obj, true', args: [null], expected: 'object' },
// undefined. like with null, there is only one value with this type
- { name: 'und, undefined', args: [undefined], expected: '' },
+ { name: 'und, undefined', args: [undefined], expected: 'undefined' },
// strings are anything with quotes around it
- { name: 'str, ', args: [''], expected: '' },
- { name: 'str, anything with quotes!', args: ['anything with quotes!'], expected: '' },
+ { name: 'str, ', args: [''], expected: 'string' },
+ { name: 'str, anything with quotes!', args: ['anything with quotes!'], expected: 'string' },
// numbers are a bit more strange and varied
{ name: 'num, 0.0', args: [0.0], expected: 'number' },
- { name: 'num, NaN', args: [NaN], expected: 'number' },
+ { name: 'num, NaN', args: [NaN], expected: 'number'},
{ name: 'num, Infinity', args: [Infinity], expected: 'number' },
{ name: 'num, 4', args: [4], expected: 'number' },
// write 6 more passing test cases with expected value 'number'
- { name: '', args: null, expected: null },
- { name: '', args: null, expected: null },
- { name: '', args: null, expected: null },
- { name: '', args: null, expected: null },
- { name: '', args: null, expected: null },
- { name: '', args: null, expected: null },
+ { name: 'num, 1', args: [1], expected: 'number'},
+ { name: 'num, 5', args: [5], expected: 'number' },
+ { name: 'num, Nan', args: [NaN], expected: 'number' },
+ { name: 'num, infinity', args: [Infinity], expected: 'number' },
+ { name: 'num, 1.1', args: [1.1], expected: 'number' },
+ { name: 'num, -2', args: [-2], expected: 'number' },
]
function allValuesHaveAType(value) {
return typeof value;
@@ -90,12 +90,12 @@ evaluate(allValuesHaveAType, typeofTests);
// fix the test cases' expected values to pass the function
const typeofReturnsAStringTests = [
- { name: 'boo, true', args: [true], expected: 'boolean' },
- { name: 'boo, false', args: [false], expected: 'boolean' },
- { name: 'obj, true', args: [null], expected: 'object' },
- { name: 'und, undefined', args: [undefined], expected: 'undefined' },
+ { name: 'boo, true', args: [true], expected: 'string' },
+ { name: 'boo, false', args: [false], expected: 'string' },
+ { name: 'obj, true', args: [null], expected: 'string' },
+ { name: 'und, undefined', args: [undefined], expected: 'string' },
{ name: 'str, anything with quotes!', args: ['anything with quotes!'], expected: 'string' },
- { name: 'num, 4', args: [4], expected: 'number' },
+ { name: 'num, 4', args: [4], expected: 'string' },
];
function typeofReturnsAString(value) {
const typeofValue = typeof value;
@@ -105,7 +105,6 @@ typeofReturnsAString.quizzing = true;
evaluate(typeofReturnsAString, typeofReturnsAStringTests);
-
function example_aBitAboutNaN() {
// NaN is the only value that does not strictly equal itself
@@ -125,16 +124,16 @@ evaluate(example_aBitAboutNaN);
// fix the expected values to pass the tests
const strictEqualityTests = [
- { name: 'NaN', args: [NaN, NaN], expected: null },
- { name: 'first', args: [true, 'true'], expected: null },
- { name: 'second', args: [1, '1'], expected: null },
- { name: 'third', args: ['1', '1'], expected: null },
- { name: 'fourth', args: [1000, 1e3], expected: null },
- { name: 'fifth', args: [+0, -0], expected: null },
- { name: 'sixth', args: [1, 1.0], expected: null },
- { name: 'seventh', args: ['', ""], expected: null },
- { name: 'eighth', args: ["", ``], expected: null },
- { name: 'ninth', args: [' ', ' '], expected: null },
+ { name: 'NaN', args: [NaN, NaN], expected: false },
+ { name: 'first', args: [true, 'true'], expected: false },
+ { name: 'second', args: [1, '1'], expected: false },
+ { name: 'third', args: ['1', '1'], expected: true },
+ { name: 'fourth', args: [1000, 1e3], expected: true },
+ { name: 'fifth', args: [+0, -0], expected: true },
+ { name: 'sixth', args: [1, 1.0], expected: true },
+ { name: 'seventh', args: ['', ""], expected: true },
+ { name: 'eighth', args: ["", ``], expected: true },
+ { name: 'ninth', args: [' ', ' '], expected: false },
];
function strictEquality(a, b) {
// if type OR value are not the same, returns false
@@ -147,16 +146,16 @@ evaluate(strictEquality, strictEqualityTests);
const strictInequalityTests = [
- { name: 'NaN', args: [NaN, NaN], expected: null },
- { name: 'first', args: [true, 'true'], expected: null },
- { name: 'second', args: [1, '1'], expected: null },
- { name: 'third', args: ['1', '1'], expected: null },
- { name: 'fourth', args: [1000, 1e3], expected: null },
- { name: 'fifth', args: [+0, -0], expected: null },
- { name: 'sixth', args: [1, 1.0], expected: null },
- { name: 'seventh', args: ['', ""], expected: null },
- { name: 'eighth', args: ["", ``], expected: null },
- { name: 'ninth', args: [' ', ' '], expected: null },
+ { name: 'NaN', args: [NaN, NaN], expected: true },
+ { name: 'first', args: [true, 'true'], expected: true},
+ { name: 'second', args: [1, '1'], expected: true},
+ { name: 'third', args: ['1', '1'], expected: false },
+ { name: 'fourth', args: [1000, 1e3], expected: false },
+ { name: 'fifth', args: [+0, -0], expected: false },
+ { name: 'sixth', args: [1, 1.0], expected: false },
+ { name: 'seventh', args: ['', ""], expected: false },
+ { name: 'eighth', args: ["", ``], expected: false },
+ { name: 'ninth', args: [' ', ' '], expected: true },
];
function strictInequality(a, b) {
// if type OR value are not the same, returns true
diff --git a/module-exercises/truthiness-operators.js b/module-exercises/truthiness-operators.js
index 086fa11..2fa8ebb 100644
--- a/module-exercises/truthiness-operators.js
+++ b/module-exercises/truthiness-operators.js
@@ -20,15 +20,19 @@ const orTests = [
{ name: '"true", NaN', args: ["true", NaN], expected: "true" },
{ name: 'NaN, NaN', args: [NaN, NaN], expected: NaN },
// complete these test cases
- { name: null, args: null, expected: null },
- { name: null, args: null, expected: null },
- { name: null, args: null, expected: null },
- { name: null, args: null, expected: null },
- { name: null, args: null, expected: null },
- { name: null, args: null, expected: null },
- { name: null, args: null, expected: null },
- { name: null, args: null, expected: null },
+ { name: '2, 2', args: [2, 2], expected: 2 },
+ { name: '0, 2', args: [0, 2], expected: 2 },
+ { name: 'NaN, "1"', args: [NaN, "1"], expected: "1" }, //I tried to [Nan, false], but I could not find a correct answer
+ { name: '1, NaN', args: [1, NaN], expected: 1 },
+ { name: '1, "false"', args: [1, "false"], expected: 1},
+ { name: '1, "true"', args: [1, "true"], expected: 1},
+ { name: '"true","true"', args: ["true", "true"], expected: "true" },
+ { name: '"false", "false"', args: ["false", "false"], expected: "false" },
];
+
+try {
+
+
function or(a, b) {
return a || b;
}
@@ -46,14 +50,14 @@ const andTests = [
{ name: '"true", NaN', args: ["true", NaN], expected: NaN },
{ name: 'NaN, NaN', args: [NaN, NaN], expected: NaN },
// complete these test cases
- { name: null, args: null, expected: null },
- { name: null, args: null, expected: null },
- { name: null, args: null, expected: null },
- { name: null, args: null, expected: null },
- { name: null, args: null, expected: null },
- { name: null, args: null, expected: null },
- { name: null, args: null, expected: null },
- { name: null, args: null, expected: null },
+ { name: 'true, 2', args: [true,2], expected: 2 },
+ { name: '"true", null', args: ["true",null], expected: null}, //i tried "true" with 1 and 2 but I could not get a correct answer
+ { name: 'NaN, 1', args: [NaN, 1], expected: NaN},
+ { name: 'NaN, "1"', args: [NaN, "1"], expected: NaN },
+ { name: '"false",1', args: ["false",1], expected: 1 }, //i expect it to be false
+ { name: 'true,0', args: [true,0], expected: 0 },
+ { name: '"true",0', args: ["true",0], expected: 0 },
+ { name: '"false",0', args: ["false",0], expected: 0 },
];
function and(a, b) {
return a && b;
@@ -69,15 +73,16 @@ const notTests = [
{ name: 'NaN', args: [NaN], expected: true },
{ name: '"hi!"', args: ['hi!'], expected: false },
// complete these test cases
- { name: null, args: null, expected: null },
- { name: null, args: null, expected: null },
- { name: null, args: null, expected: null },
- { name: null, args: null, expected: null },
- { name: null, args: null, expected: null },
- { name: null, args: null, expected: null },
- { name: null, args: null, expected: null },
- { name: null, args: null, expected: null },
+ { name: 'null', args: [null], expected: true },
+ { name: '2', args: [2], expected: false },
+ { name: 'true', args: [true], expected: false },
+ { name: '"true"', args: ["true"], expected: false },
+ { name: 'false', args: [false], expected: true},
+ { name: '"false"', args: ["false"], expected: false }, // as I understand "false","true","astring" or whatever in a "" is a string.Doesn't matter what is written inside.
+ { name: '"aString"', args: ["aString"], expected: false },
+ { name: '"numberZero"', args: ["numberZero"], expected: false},
];
+
function not(a) {
return !a;
}
@@ -92,14 +97,14 @@ const ternaryTests = [
{ name: '"hi!"', args: ['hi!', '?', ':'], expected: '?' },
{ name: '0', args: [0, 'truthy', 'falsey'], expected: 'falsey' },
// complete these test cases
- { name: null, args: null, expected: null },
- { name: null, args: null, expected: null },
- { name: null, args: null, expected: null },
- { name: null, args: null, expected: null },
- { name: null, args: null, expected: null },
- { name: null, args: null, expected: null },
- { name: null, args: null, expected: null },
- { name: null, args: null, expected: null },
+ { name: '1', args: [1,'true', 'false'], expected: 'true' },
+ { name: 'undefined', args: ['undefined',1,2], expected: 1 },
+ { name: 'null', args: [null,true,false], expected: false },
+ { name: '0', args: ['0','yes','no'], expected: 'yes'},
+ { name: 'wow', args: ['wow','ja','nee'], expected: 'ja'},
+ { name: '"wow"', args: ['wow',1,2], expected: 1 },
+ { name: 'NaN', args: ['NaN',1,2], expected: 1 },
+ { name: '0', args: ['0',1,2], expected: 1 },
];
function ternary(a, b, c) {
return a ? b : c;
@@ -107,7 +112,13 @@ function ternary(a, b, c) {
ternary.quizzing = true;
evaluate(ternary, ternaryTests);
-
+}
+catch (err) {
+ console.log(err);
+ document.body.appendChild(
+ evaluate.errorSearchComponent('.js file', err)
+ );
+}
{
console.groupEnd();
document.body.appendChild(document.createElement('hr'));
diff --git a/module-exercises/truthiness.js b/module-exercises/truthiness.js
index 1ab700d..177d39f 100644
--- a/module-exercises/truthiness.js
+++ b/module-exercises/truthiness.js
@@ -8,6 +8,8 @@
console.groupCollapsed(pageTitle);
}
+try {
+
function example_truthinessIsCastingToBoolean() {
const valuesToStudy = [
@@ -38,12 +40,12 @@ const truthinessTests = [
{ name: '-0', args: [-0], expected: 'falsey' },
{ name: 'NaN', args: [NaN], expected: 'falsey' },
// try it yourself! write some more test cases
- { name: '', args: null, expected: null },
- { name: '', args: null, expected: null },
- { name: '', args: null, expected: null },
- { name: '', args: null, expected: null },
- { name: '', args: null, expected: null },
- { name: '', args: null, expected: null },
+ { name: 'NaN', args: [NaN], expected: 'falsey' }, //i did not understand what to write here. i tried truthy cases but it did not accept my results as true. i could not find another falsey cases.
+ { name: '0', args: [0], expected: 'falsey' },
+ { name: '""', args: [""], expected: 'falsey' },
+ { name: '-0', args: [-0], expected: 'falsey' },
+ { name: 'null', args: [null], expected: 'falsey' },
+ { name: 'false', args: [false], expected: 'falsey' },
];
function truthinessByTestCase(x) {
const coercedToBool = Boolean(x);
@@ -57,30 +59,37 @@ evaluate(truthinessByTestCase, truthinessTests);
// change the expected values from null to true or false
// and come on. don't just use trial and error, think a bit harder!
const testsToPass = [
- { name: 'first', args: [0.0], expected: null },
- { name: 'second', args: [null], expected: null },
- { name: 'third', args: ['hacking your future!'], expected: null },
- { name: "fourth", args: [''], expected: null },
- { name: 'fifth', args: ["--<(*)>--"], expected: null },
- { name: 'sixth', args: [undefined], expected: null },
- { name: 'seventh', args: [""], expected: null },
- { name: 'eighth', args: [Symbol('hello')], expected: null },
- { name: 'ninth', args: [``], expected: null },
- { name: 'tenth', args: [true], expected: null },
- { name: 'eleventh', args: [1e3], expected: null },
- { name: 'twelfth', args: [0], expected: null },
- { name: 'thirteenth', args: [Symbol()], expected: null },
- { name: 'fourteenth', args: [-0], expected: null },
- { name: 'fifteenth', args: [NaN], expected: null },
- { name: 'sixteenth', args: [Infinity], expected: null },
- { name: 'seventeenth', args: [Symbol(false)], expected: null },
- { name: 'eighteenth', args: [+0], expected: null },
- { name: 'nineteenth', args: [false], expected: null },
+ { name: 'first', args: [0.0], expected: false },
+ { name: 'second', args: [null], expected: false },
+ { name: 'third', args: ['hacking your future!'], expected: true},
+ { name: "fourth", args: [''], expected: false },
+ { name: 'fifth', args: ["--<(*)>--"], expected: true },
+ { name: 'sixth', args: [undefined], expected: false },
+ { name: 'seventh', args: [""], expected: false },
+ { name: 'eighth', args: [Symbol('hello')], expected: true },
+ { name: 'ninth', args: [``], expected: false },
+ { name: 'tenth', args: [true], expected: true },
+ { name: 'eleventh', args: [1e3], expected: true },
+ { name: 'twelfth', args: [0], expected: false },
+ { name: 'thirteenth', args: [Symbol()], expected: true },
+ { name: 'fourteenth', args: [-0], expected: false },
+ { name: 'fifteenth', args: [NaN], expected: false },
+ { name: 'sixteenth', args: [Infinity], expected: true },
+ { name: 'seventeenth', args: [Symbol(false)], expected: true },
+ { name: 'eighteenth', args: [+0], expected: false },
+ { name: 'nineteenth', args: [false], expected: false },
];
Boolean.quizzing = true;
evaluate(Boolean, testsToPass);
delete Boolean.quizzing;
+} catch (err) {
+ console.log(err);
+ document.body.appendChild(
+ evaluate.errorSearchComponent('.js file', err)
+ );
+}
+
{
console.groupEnd();
document.body.appendChild(document.createElement('hr'));
diff --git a/module-exercises/variables.js b/module-exercises/variables.js
index 0ed91de..325851c 100644
--- a/module-exercises/variables.js
+++ b/module-exercises/variables.js
@@ -82,7 +82,10 @@ function threeVariableSwap1() {
let temp = '';
// can be done in 4 lines
-
+ temp=a;
+ a=b;
+ b=c;
+ c=temp;
console.assert(a === "a", "a should store 'a'");
console.assert(b === "b", "b should store 'b'");
@@ -96,7 +99,11 @@ function threeVariableSwap2() {
let temp = '';
// can be done in 4 lines
-
+
+ temp=a;
+ a=c;
+ c=b;
+ b=temp
console.assert(a === "a", "a should store 'a'");
console.assert(b === "b", "b should store 'b'");
@@ -110,7 +117,11 @@ function fourVariableSwap1() {
let temp = '';
// can be done in 5 lines
-
+ temp=a;
+ a=b;
+ b=c;
+ c=d;
+ d=temp;
console.assert(a === "a", "a should store 'a'");
console.assert(b === "b", "b should store 'b'");
@@ -125,6 +136,13 @@ function fourVariableSwap2() {
let temp = '';
// can be done in 6 lines
+ temp=a
+ a=d
+ d=temp
+ temp=c
+ c=b
+ b=temp
+
console.assert(a === "w", "a should store 'w'");
@@ -141,6 +159,13 @@ function fiveVariableSwap() {
// can be done in 6 lines
+ temp=a
+ a=e
+ e=temp
+ temp=b
+ b=d
+ d=temp
+
console.assert(a === "v", "a should store 'v'");
console.assert(b === "w", "b should store 'w'");
@@ -190,7 +215,7 @@ function multipleAssignments1() {
// can be done in 1 line
-
+ temp=a,a=b,b=c,c=temp;
console.assert(a === "a", "a should store 'a'");
console.assert(b === "b", "b should store 'b'");
console.assert(c === "c", "c should store 'c'");
@@ -204,7 +229,7 @@ function multipleAssignments2() {
// can be done in 1 line
-
+ temp=a,a=c,c=b,b=temp;
console.assert(a === "a", "a should store 'a'");
console.assert(b === "b", "b should store 'b'");
console.assert(c === "c", "c should store 'c'");
@@ -217,7 +242,7 @@ function multipleAssignments3() {
let temp = '';
// can be done in 1 line
-
+ temp=a,a=b,b=c,c=d,d=temp;
console.assert(a === "a", "a should store 'a'");
console.assert(b === "b", "b should store 'b'");
@@ -233,7 +258,7 @@ function multipleAssignments4() {
// can be done in 1 line
-
+ temp=a,a=d,d=temp,temp=b,b=c,c=temp;
console.assert(a === "w", "a should store 'w'");
console.assert(b === "x", "b should store 'x'");
console.assert(c === "y", "c should store 'y'");
@@ -270,6 +295,11 @@ function chainedAssignments1() {
// can be done in 3 lines or less
+ temp=b;
+b=a1;
+a1=a2=temp;
+
+
console.assert(a1 === "a", 'a1 should store "a"');
console.assert(a1 === a2, 'a1 should store the same value as a2');
console.assert(b === "b", 'b should store "b"');
@@ -286,6 +316,7 @@ function chainedAssignments2() {
// can be done in 4 lines or less
+ temp=a,a=b1,b1=b2=c1,c1=c2=c3=temp;
console.assert(a === "a", 'a should store "a"');
@@ -317,7 +348,7 @@ function footnote_var() {
evaluate(footnote_var);
-{
+
console.groupEnd();
document.body.appendChild(document.createElement('hr'));
-}
+
diff --git a/week-1-project/devowel-handler.js b/week-1-project/devowel-handler.js
index c50d2d2..a96be7f 100644
--- a/week-1-project/devowel-handler.js
+++ b/week-1-project/devowel-handler.js
@@ -12,20 +12,29 @@ the handler is already set up to:
*/
function devowelHandler() {
-
// read and process user input (this works, no need to change it!)
- const toDevowel = document.getElementById('devowel-input').value;
+ const toDevowel = document.getElementById("devowel-input").value;
// pass user input through core logic (write this! it doesn't work)
- const devoweled = `remove all vowels from ${toDevowel}`;
+ function wegvowels() {
+ const vowels = ["a", "e", "o",'ø', "i", "u", "ü"];
+ return toDevowel
+ .split("")
+ .filter(function(wv) {
+ return vowels.indexOf(wv.toLowerCase()) == -1;
+ })
+ .join("");
+ }
+ const devoweled = wegvowels();
+
// report result to user (this works, no need to change it!)
- const outputField = document.getElementById('devowel-output');
+ const outputField = document.getElementById("devowel-output");
outputField.innerHTML = devoweled;
- console.log('\n--- devowelHandler ---');
- console.log('toDevowel:', typeof toDevowel, ',', toDevowel);
- console.log('devoweled:', typeof devoweled, ',', devoweled);
-};
-const devowelButton = document.getElementById('devowel-button');
-devowelButton.addEventListener('click', devowelHandler);
+ console.log("\n--- devowelHandler ---");
+ console.log("toDevowel:", typeof toDevowel, ",", toDevowel);
+ console.log("devoweled:", typeof devoweled, ",", devoweled);
+}
+const devowelButton = document.getElementById("devowel-button");
+devowelButton.addEventListener("click", devowelHandler);
diff --git a/week-1-project/README.md b/week-1-project/https:/akbelcolak.github.io/readme.md
similarity index 100%
rename from week-1-project/README.md
rename to week-1-project/https:/akbelcolak.github.io/readme.md
diff --git a/week-1-project/index.html b/week-1-project/index.html
index 9397ef9..e784d39 100644
--- a/week-1-project/index.html
+++ b/week-1-project/index.html
@@ -1,55 +1,119 @@
-
+
-
-
-
-
- week 1 project
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+ welcome to javascript Akbel
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ You can type anything you like in the box below. It will sort your entry
+ according to charCode.
+
+
+
+
+
+ You can type anything you like in the box below. It will reverse your
+ entry. Try to read it aloud!
+
+
+
+
+ You can type anything you like in the box below. It will shrink your entry
+ by deleting all the wovels. Do you remember the times when there is no
+ internet in your phone and messages were so expensive. So that you had to
+ type without wovels and also understand what your friend has written to
+ you. If you don't remember or did not experience it, you should definetly
+ try it!
+
+
+
+
+ You can type anything you like in the box below. It is a version of
+ Parrot. Just repeats what you say. Then don't afraid to say it, I LOVE YOU
+ and I Believe You, You Can Do It!
+
+
+
+
+
+
+
+
+
+ JavasSript first week homework, Akbel 2019
+
diff --git a/week-1-project/repeat-handler.js b/week-1-project/repeat-handler.js
index d0c5d72..c5593eb 100644
--- a/week-1-project/repeat-handler.js
+++ b/week-1-project/repeat-handler.js
@@ -13,27 +13,27 @@ the handler is already set up to:
*/
function repeatHandler() {
-
// read and process user input (this works, no need to change it!)
- const strToRepeat = document.getElementById('repeat-string-input').value;
+ const strToRepeat = document.getElementById("repeat-string-input").value;
- const rawNumInput = document.getElementById('repeat-number-input').value;
+ const rawNumInput = document.getElementById("repeat-number-input").value;
const numOfRepetitions = Number(rawNumInput);
if (numOfRepetitions !== numOfRepetitions) {
throw new TypeError('second input to "repeat it" must be a number');
}
-
// pass user input through core logic (write this! it doesn't work)
- const repeated = `repeat ${strToRepeat} ${numOfRepetitions} times`;
+
+
+ const repeated = strToRepeat.repeat(numOfRepetitions);
// report result to user (this works, no need to change it!)
- const outputField = document.getElementById('repeat-output');
+ const outputField = document.getElementById("repeat-output");
outputField.innerHTML = repeated;
- console.log('\n--- repeatHandler ---');
- console.log('strToRepeat:', typeof strToRepeat, ',', strToRepeat);
- console.log('repeated:', typeof repeated, ',', repeated);
-};
-const repeatButton = document.getElementById('repeat-button');
-repeatButton.addEventListener('click', repeatHandler);
+ console.log("\n--- repeatHandler ---");
+ console.log("strToRepeat:", typeof strToRepeat, ",", strToRepeat);
+ console.log("repeated:", typeof repeated, ",", repeated);
+}
+const repeatButton = document.getElementById("repeat-button");
+repeatButton.addEventListener("click", repeatHandler);
diff --git a/week-1-project/reverse-handler.js b/week-1-project/reverse-handler.js
index 6682c5f..6565647 100644
--- a/week-1-project/reverse-handler.js
+++ b/week-1-project/reverse-handler.js
@@ -17,9 +17,14 @@ function reverseHandler() {
// read and process user input (this works, no need to change it!)
const toReverse = document.getElementById('reverse-input').value;
- // pass user input through core logic (write this! it doesn't work)
- const reversed = `reverse ${toReverse}`;
-
+ // pass user input through core logic (write this! it doesn't work)
+
+ function forReverse(){
+ return toReverse.split('').reverse().join('');
+ };
+ const reversed = forReverse() ;
+
+
// report result to user (this works, no need to change it!)
const outputField = document.getElementById('reverse-output');
outputField.innerHTML = reversed;
diff --git a/week-1-project/sort-handler.js b/week-1-project/sort-handler.js
index e45575f..847eb79 100644
--- a/week-1-project/sort-handler.js
+++ b/week-1-project/sort-handler.js
@@ -1,14 +1,11 @@
/*
-
write a little javascript to:
- take in the string 'toSort'
- sort all of the characters by charCode number
- and assign the new string to 'sorted'
-
the handler is already set up to:
- read user input to the variable 'toSort'
- write 'sorted' to the output
-
*/
@@ -17,8 +14,12 @@ function sortHandler() {
// read and process user input (this works, no need to change it!)
const toSort = document.getElementById('sort-input').value;
- // pass user input through core logic (write this! it doesn't work)
- const sorted = `sort the charecters in ${toSort}`;
+// pass user input through core logic (write this! it doesn't work)
+
+ function sortArray() {
+ return toSort.split('').sort().join('');
+ }
+ const sorted =sortArray();
// report result to user (this works, no need to change it!)
const outputField = document.getElementById('sort-output');
@@ -29,4 +30,4 @@ function sortHandler() {
console.log('sorted:', typeof sorted, ',', sorted);
};
const sortButton = document.getElementById('sort-button');
-sortButton.addEventListener('click', sortHandler);
+sortButton.addEventListener('click', sortHandler);
\ No newline at end of file
diff --git a/week-1-project/style.css b/week-1-project/style.css
index e69de29..901237b 100644
--- a/week-1-project/style.css
+++ b/week-1-project/style.css
@@ -0,0 +1,96 @@
+body{
+ font-family: 'Dosis', sans-serif;
+ background-color:#f2ad9f;
+ margin:0;
+ padding:0;
+ color:#323339;
+ text-align: center;
+ width: 80%;
+ }
+
+
+header{
+ text-align: center;
+ font: 30px;
+ margin: 20px;
+ padding-top:30px;
+ padding-bottom: 30px;
+ min-height:80px;
+ color: #6cbf84
+
+ }
+ .box {
+ max-width: 600px;
+ text-align: center;
+ margin: auto;
+ margin-top: 25px;
+ margin-bottom: 25px;
+ }
+ ul{
+ margin:0;
+ padding:0;
+ }
+
+ .colored {color: #f26968}
+
+ header a{
+ color:#dfe2d2;
+ text-decoration:none;
+ text-transform: uppercase;
+ font-size:12px;
+
+ }
+
+ header li{
+ float:right;
+ padding: 0 10px 0 10px;
+ display: inline;
+ }
+
+ button {
+ background-color: #6cbf84;
+ border: none;
+ height: 30px;
+ width: 400px;
+ color: #dfe2d2;
+ margin: 5px;
+ font-size: 18px;
+ }
+
+ button:hover {
+ background-color: #323339;
+ }
+
+ input {
+ color: #323339;
+ font-size: 14px;
+ }
+
+ footer{
+ padding:20px;
+ background-color:#dfe2d2;
+ color:#f2ad9f;
+ margin-top:20px;
+ text-align: center;
+ bottom: 0;
+ width: 100%;
+ position: fixed;
+ }
+
+#repeat-container {
+ margin-bottom: 100px;
+}
+
+
+ @media (max-width: 680px) {
+ .box {
+ max-width: 400px;
+ text-align: center;
+ margin: auto;
+ margin-top: 10px;
+ padding: 10px;
+ }
+
+ body {
+ font-size: 0.8em;
+ }
\ No newline at end of file
diff --git a/week-2-project/.DS_Store b/week-2-project/.DS_Store
new file mode 100644
index 0000000..0c07ac5
Binary files /dev/null and b/week-2-project/.DS_Store differ
diff --git a/week-2-project/index.html b/week-2-project/index.html
index 8badc8c..f8653e8 100644
--- a/week-2-project/index.html
+++ b/week-2-project/index.html
@@ -5,54 +5,70 @@
- week 2 project
+ AKBEL-week 2 project
-
+
+
+ HELLo from week two javascript project
+
+
-
-
-
-
+
+
+
The function should give you 2 times of the letters, 3 times of the numbers, 4 times of the symbols and the space.
+
-
+
+
+
The function should make every letters capital and ignore the symbols. Also the space should be '_'
+
-
-
+
+
+
The function should shift the letters you typed according to the number you gave.
+
+
+
+
+
Type a word, give a length (a number), choose a pattern or just leave it.
+ The function should translate the word you typed according to the length that you wanted.
+
+
+
+
-
-
-
-
-
+
-