Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width">
- <title>JS Bin</title>
- </head>
- <body>
- <script id="jsbin-javascript">
- //--------------------------------
- //Name: Eric Schroeter
- //--------------------------------
- //-------------------------------
- // Exercise: Property Path Evaluation
- //-------------------------------
- //--------------------------
- // Exercise: Sum Nested Arrays
- //--------------------------
- let list = [0,1,2,3,4,5,6,7,8,9,10];
- let count = 0;
- let numHoldOne = 0;
- let numHoldTwo = 0;
- let total = 0;
- function sumNested(object) {
- while (count < object.length) {
- numHoldOne = object[count];
- console.log(object[count]);
- numHoldTwo = numHoldOne;
- total = total + numHoldTwo;
- count++;
- }
- }
- //console.log(list.length);
- console.log(sumNested(list));
- //---------------------------
- // Exercise: Word Count
- //---------------------------
- let abc = 'The dog is walking down the street';
- function wordCount(string) {
- }
- //-----------------------------
- // Exercise: Anagram Tester
- //----------------------------
- let one = 'abc';
- let two = 'bca';
- let three = 'cde';
- let stringOneLength = stringOne.length;
- let stringTwoLength = stringTwo.length;
- //compare each character in the first string to the other characters in the second string
- function areTheseAnagrams(stringOne, stringTwo) {
- if (stringOneLength !== stringTwoLength) {
- return 'False'
- } else {
- for (let count = 0; count < stringOneLength && count < stringTwoLength; count ++) {
- if(stringOne.charAt(count) === stringTwo.charAt(count)) {
- return 'True'
- } else break;
- }
- }
- }
- </script>
- <script id="jsbin-source-javascript" type="text/javascript">
- //--------------------------------
- //Name: Eric Schroeter
- //--------------------------------
- //-------------------------------
- // Exercise: Property Path Evaluation
- //-------------------------------
- //--------------------------
- // Exercise: Sum Nested Arrays
- //--------------------------
- let list = [0,1,2,3,4,5,6,7,8,9,10];
- let count = 0;
- let numHoldOne = 0;
- let numHoldTwo = 0;
- let total = 0;
- function sumNested(object) {
- while (count < object.length) {
- numHoldOne = object[count];
- console.log(object[count]);
- numHoldTwo = numHoldOne;
- total = total + numHoldTwo;
- count++;
- }
- }
- //console.log(list.length);
- console.log(sumNested(list));
- //---------------------------
- // Exercise: Word Count
- //---------------------------
- let abc = 'The dog is walking down the street';
- function wordCount(string) {
- }
- //-----------------------------
- // Exercise: Anagram Tester
- //----------------------------
- let one = 'abc';
- let two = 'bca';
- let three = 'cde';
- let stringOneLength = stringOne.length;
- let stringTwoLength = stringTwo.length;
- //compare each character in the first string to the other characters in the second string
- function areTheseAnagrams(stringOne, stringTwo) {
- if (stringOneLength !== stringTwoLength) {
- return 'False'
- } else {
- for (let count = 0; count < stringOneLength && count < stringTwoLength; count ++) {
- if(stringOne.charAt(count) === stringTwo.charAt(count)) {
- return 'True'
- } else break;
- }
- }
- }
- </script></body>
- </html>
Add Comment
Please, Sign In to add comment