diff --git a/MaxM.js b/MaxM.js new file mode 100644 index 0000000..e53fb72 --- /dev/null +++ b/MaxM.js @@ -0,0 +1,11 @@ +// morning coding chalenge +// this is also my first attempt at coe in Js in the command line editer. if only vi had spell check.lol + + +function reverseNumber(num) { + let result = num.toString(); + let result1 = result.split("").reverse().join(""); + let result2 = Number(result1) + return result2; +} + console.log(reverseNumber(12345)); diff --git a/MaxM.txt b/MaxM.txt new file mode 100644 index 0000000..03ebd5d --- /dev/null +++ b/MaxM.txt @@ -0,0 +1,3 @@ + +New file +no info of importance. diff --git a/VariablesChalenge.js b/VariablesChalenge.js new file mode 100644 index 0000000..b83bad5 --- /dev/null +++ b/VariablesChalenge.js @@ -0,0 +1,65 @@ + +[200~/* ==== Challenge 1: ==== + - Create a variable named `name` + - Assign it's value to your first and last name + - Does this variable need to be a constant? It depends completely on you! It should be a const variable IF you intend to never change your name. + */ + + code for `name` goes here + const name = 'Max David Metelus'; + + /* ==== Challenge 2: ==== + - Create a variable called `age` + - UNLESS you've descovered a very important secret in life, you should probably allow for `mutability` here. + */ + + // code for `age` goes here + let age = '34'; + + /* ==== Challenge 3: ==== + - Create a variable called `myLocation` + - Base the value on where you're currently sitting. Consider if this is something that could change eventually. + */ + + // code for `myLocation` goes here + let myLocation = 'in a chair'; + + /* ==== Challenge 4: ==== + - Create a variable called `faveBook` + - Consider if this is some data about yourself that could change. + */ + + // code for `faveBook` goes here + const faveBook = 'The Bible'; + + /* ==== Challenge 5: ==== + - Create a variable called `faveBand` + - Consider if this is some data about yourself that could change. + */ + + // code for `faveBand` goes here + let faveBand = null; + + /* ==== Challenge 6: ==== + - Problem create a variable called `faveFood` + - Consider if this is some data about yourself that could change. + */ + + // code for `faveFood` goes here + const faveFood = 'My Cooking'; + + /* ==== Challenge 7: ==== + - Look at the function declaration named `example` below + - Comment `block scope` where you see block scope + - Comment `function scope` where you see function scope + */ + + function example() { + //function scope( block scope too!) + if(true){ + //block scope + } + } + + + // Check your work against some potential solutions when you're finished: https://codepen.io/lambdaschool/pen/ejbEGN?editors=0012 diff --git a/jsBinObjectsExersize.js b/jsBinObjectsExersize.js new file mode 100644 index 0000000..b7f56a6 --- /dev/null +++ b/jsBinObjectsExersize.js @@ -0,0 +1,45 @@ +/* + Objects are used all over in JavaScript. + These following problems will help you get a better feel for object literals + We want you familiar with the following Object methods: + .keys(), .values(), .entries(), . + https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/prototype +*/ + +/* + Problem 1: Giver Info + return an array of an Objects properties/keys +*/ + +const student = { name: 'Jonas', age: '12', gender: 'M', role: 'Receiver' }; +const studentKeys = Object.keys(student);// finish this. + +/* + Problem 2: Giver Info + using the same object as above. + return an array of an Objects values +*/ + +const studentValues = Object.values(student); // finish this. + +/* + Problem 3: Giver Info + Add a list of charecters to Jonas' object + The list should be called 'characters' and it should be an array. + example: + { name: 'Jonas', age: '12', gender: 'M', role: 'Receiver', characters: ['Lily', 'Mother', 'Father', 'Caleb', 'Asher']} + next: select that list and iterate over it using `.forEach` simply log the name of each char in the list; +*/ + +//const listOfChars = student.characters; // finish this. + +student.characters = []; +student.characters.push['Lily']; +student.characters.push['Mother']; +student.characters.push['Father']; +student.characters.push['Caleb']; +student.characters.push['Asher']; + +character.forEach(list(){ + console.log(list) + }) diff --git a/jsBinObjectsExersizeA.js b/jsBinObjectsExersizeA.js new file mode 100644 index 0000000..19b5921 --- /dev/null +++ b/jsBinObjectsExersizeA.js @@ -0,0 +1,45 @@ +/* + Objects are used all over in JavaScript. + These following problems will help you get a better feel for object literals + We want you familiar with the following Object methods: + .keys(), .values(), .entries(), . + https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/prototype +*/ + +/* + Problem 1: Giver Info + return an array of an Objects properties/keys +*/ + +const student = { name: 'Jonas', age: '12', gender: 'M', role: 'Receiver' }; +const studentKeys = Object.keys(student);// finish this. + +/* + Problem 2: Giver Info + using the same object as above. + return an array of an Objects values +*/ + +const studentValues = Object.values(student); // finish this. + +/* + Problem 3: Giver Info + Add a list of charecters to Jonas' object + The list should be called 'characters' and it should be an array. + example: + { name: 'Jonas', age: '12', gender: 'M', role: 'Receiver', characters: ['Lily', 'Mother', 'Father', 'Caleb', 'Asher']} + next: select that list and iterate over it using `.forEach` simply log the name of each char in the list; +*/ + +//const listOfChars = student.characters; // finish this. + +student.characters = []; +student.characters.push['Lily']; +student.characters.push['Mother']; +student.characters.push['Father']; +student.characters.push['Caleb']; +student.characters.push['Asher']; + +character.forEach(list(){ + console.log(list); +}); diff --git a/mMetelus.txt b/mMetelus.txt new file mode 100644 index 0000000..4cebde6 --- /dev/null +++ b/mMetelus.txt @@ -0,0 +1 @@ +New file for the demo \ No newline at end of file diff --git a/testOut/index.html b/testOut/index.html new file mode 100644 index 0000000..0f2924a --- /dev/null +++ b/testOut/index.html @@ -0,0 +1,75 @@ + + + + + + + + Learnnig Javascript + + + + + + + +
+

+

+ +

+

+ +

+
+ +
+

+

+

+

+

+
+
+

+ + + +

+ + + + + + \ No newline at end of file