diff --git a/.vscode/._settings.json b/.vscode/._settings.json new file mode 100755 index 0000000..b9ba0b7 Binary files /dev/null and b/.vscode/._settings.json differ diff --git a/.vscode/settings.json b/.vscode/settings.json old mode 100644 new mode 100755 diff --git a/README.md b/README.md old mode 100644 new mode 100755 diff --git a/dom-playground-master/.gitignore b/dom-playground-master/.gitignore new file mode 100755 index 0000000..330c75b --- /dev/null +++ b/dom-playground-master/.gitignore @@ -0,0 +1,2 @@ +/.vscode +.DS_Store \ No newline at end of file diff --git a/dom-playground-master/README.md b/dom-playground-master/README.md new file mode 100755 index 0000000..42dc69c --- /dev/null +++ b/dom-playground-master/README.md @@ -0,0 +1,25 @@ +# DOM Playground + +## Instructions +Modify `js/fix-the-page.js` to fix the page design and layout. When complete, your page should look like the original, "[Wicked Grove](http://www.csszengarden.com/006/)" design. + +## Rules +1) You may not modify the HTML file. +2) You may not modify the CSS file. + +You can use the original HTML and CSS files for reference. + +## What You Need to Know +This assignment is designed to test your knowledge of the following JavaScript features: + +* `document.querySelector()` +* `document.createElement()` +* `element.appendChild()` +* `element.innerHTML` +* `element.style` +* `element.attribute` +* `Array.forEach()` +* The DOM +* Object Literals `{}` +* and more ...! + diff --git a/dom-playground-master/css/style.css b/dom-playground-master/css/style.css new file mode 100755 index 0000000..e2f1014 --- /dev/null +++ b/dom-playground-master/css/style.css @@ -0,0 +1,211 @@ +/* Check the original CSS file for the correct body styles */ +/* It looks like they've been deleted from here. */ +/* Remember, you cannot edit this file. Add the properties using JavaScript. */ +body {} + +p { + font: 10pt/16pt "Trebuchet MS", sans-serif; + margin-top: 0px; + text-align: justify; +} + +h3 { + font: bold normal 12pt "Trebuchet MS", sans-serif; + letter-spacing: 3px; + margin-bottom: 2px; + color: #333333; + text-align: left; +} + +a:link { + font-weight: bold; + text-decoration: none; + color: #FF6600; +} + +a:visited { + font-weight: bold; + text-decoration: none; + color: #CC0000; +} + +a:hover, +a:active { + text-decoration: underline; + color: #FF6600; +} + + +/* Here's a class that you'll need to add to the HTML */ +.page-wrapper { + background: #9cf url(../images/trees.jpg) no-repeat left top; + padding: 200px 0px 0px 0px; + margin: 0px auto; + width: 800px; + border-left: 2px dashed #fff; + border-right: 2px dashed #fff; +} + +header { + margin-bottom: 10px; +} + +/* using an image to replace text in an h1. This trick courtesy Douglas Bowman, http://www.stopdesign.com/articles/css/replace-text/ */ +header h1 { + background: transparent; + margin-top: -180px; + width: 500px; + height: 87px; + float: left; + color: #fff; + + text-indent: 100%; + white-space: nowrap; + overflow: hidden; +} + +header h2 { + background: transparent url(../images/tag.gif) no-repeat top left; + width: 300px; + margin-top: -60px; + margin-left: -190px; + height: 100px; + float: right; + + text-indent: 100%; + white-space: nowrap; + overflow: hidden; +} + + +/* Add this class to the proper element */ +.summary { + width: 130px; + float: left; + padding: 5px; + margin-right: 15px; + background: #0099FF; + +} + +.summary p { + font: bold 8pt/12pt verdana, sans-serif; + text-align: right; + color: #fff; +} + +.summary a:link { + font-weight: bold; + text-decoration: none; + color: #003; +} + +.summary a:visited { + font-weight: bold; + text-decoration: none; + color: #006; +} + +.summary a:hover, +.summary a:active { + text-decoration: underline; + color: #FF6600; +} + +.preamble, +#supporting text, +.explanation, +.participation, +.benefits, +.requirements { + padding: 0px 170px 0px 30px; +} + +footer { + text-align: center; +} + +footer a:link, +footer a:visited { + margin-right: 20px; +} + +/* This class is also missing from the HTML file. Add it! */ +.sidebar { + background: transparent url(../images/menu.gif) top left no-repeat; + position: absolute; + top: 0px; + padding: 15px; + margin-top: 200px; + margin-left: 650px; + width: 130px; +} + +.sidebar .wrapper { + font: 10px verdana, sans-serif; + padding-top: 35px; +} + +.sidebar h3.select { + background: transparent url(../images/select.gif) top left no-repeat; + width: 130px; + height: 25px; + margin-left: -8px; + + text-indent: 100%; + white-space: nowrap; + overflow: hidden; +} + +.sidebar h3.archives { + background: transparent url(../images/archives.gif) top left no-repeat; + width: 130px; + height: 25px; + margin-left: -8px; + + text-indent: 100%; + white-space: nowrap; + overflow: hidden; +} + +.sidebar h3.resources { + background: transparent url(../images/resources.gif) top left no-repeat; + width: 130px; + height: 25px; + margin-left: -8px; + + text-indent: 100%; + white-space: nowrap; + overflow: hidden; +} + +.sidebar ul { + margin: 0px; + padding: 0px; +} + +.sidebar li { + line-height: 2.5ex; + background: transparent; + display: block; + padding-top: 5px; + margin-bottom: 5px; + list-style-type: none; +} + +.sidebar li a:link { + color: #FF3300; +} + +.sidebar li a:visited { + color: #FF0000; +} + +.extra1 { + background: transparent; + position: absolute; + top: 40px; + right: 0px; + width: 148px; + height: 110px; +} \ No newline at end of file diff --git a/dom-playground-master/css/style.orig.css b/dom-playground-master/css/style.orig.css new file mode 100755 index 0000000..e52af6e --- /dev/null +++ b/dom-playground-master/css/style.orig.css @@ -0,0 +1,198 @@ +/* css Zen Garden submission 006 - 'Wicked Grove' by D. Keith Robinson, http://www.7nights.com/asterisk/ */ +/* css released under Creative Commons ShareAlike License v1.0 - http://creativecommons.org/licenses/sa/1.0/ */ +/* All associated graphics copyright 2003, D. Keith Robinson */ + + +/* IMPORTANT */ +/* This design is not a template. You may not reproduce it elsewhere without the designer's written permission. */ +/* The CSS itself may freely be used for anything you wish, but the associated graphics belong to the designer. */ +/* What you may use - .css files. What you may not use - .jpg, .gif, and .png files. */ + + +/* basic elements */ +body { + font: 10pt/14pt "Trebuchet MS", sans-serif; + color: #000033; + background: #69f; + margin: 0px; + } +p { + font: 10pt/16pt "Trebuchet MS", sans-serif; + margin-top: 0px; + text-align: justify; + } +h3 { + font: bold normal 12pt "Trebuchet MS", sans-serif; + letter-spacing: 3px; + margin-bottom: 2px; + color: #333333; + text-align: left; + } +a:link { + font-weight: bold; + text-decoration: none; + color: #FF6600; + } +a:visited { + font-weight: bold; + text-decoration: none; + color: #CC0000; + } +a:hover, a:active { + text-decoration: underline; + color: #FF6600; + } + + +/* specific divs */ +.page-wrapper { + background: #9cf url(../images/trees.jpg) no-repeat left top; + padding: 200px 0px 0px 0px; + margin: 0px auto; + width:800px; + border-left: 2px dashed #fff; + border-right: 2px dashed #fff; + } + +header { + margin-bottom: 10px; + } + +/* using an image to replace text in an h1. This trick courtesy Douglas Bowman, http://www.stopdesign.com/articles/css/replace-text/ */ +header h1 { + background: transparent; + margin-top: -180px; + width: 500px; + height: 87px; + float: left; + color:#fff; + + text-indent: 100%; + white-space: nowrap; + overflow: hidden; + } +header h2 { + background: transparent url(tag.gif) no-repeat top left; + width: 300px; + margin-top:-60px; + margin-left:-190px; + height: 100px; + float: right; + + text-indent: 100%; + white-space: nowrap; + overflow: hidden; + } + +.summary { + width: 130px; + float: left; + padding:5px; + margin-right:15px; + background:#0099FF; + + } +.summary p { + font: bold 8pt/12pt verdana, sans-serif; + text-align:right; + color:#fff; + } + +.summary a:link { + font-weight: bold; + text-decoration: none; + color: #003; + } +.summary a:visited { + font-weight: bold; + text-decoration: none; + color: #006; + } +.summary a:hover, .summary a:active { + text-decoration: underline; + color: #FF6600; + } + +.preamble, #supporting text, .explanation, .participation, .benefits, .requirements { + padding: 0px 170px 0px 30px; +} + +footer { + text-align: center; + } +footer a:link, footer a:visited { + margin-right: 20px; + } + +.sidebar { + background: transparent url(menu.gif) top left no-repeat; + position: absolute; + top: 0px; + padding: 15px; + margin-top: 200px; + margin-left: 650px; + width: 130px; + } + +.sidebar .wrapper { + font: 10px verdana, sans-serif; + padding-top:35px; + } +.sidebar h3.select { + background: transparent url(select.gif) top left no-repeat; + width: 130px; + height: 25px; + margin-left:-8px; + + text-indent: 100%; + white-space: nowrap; + overflow: hidden; + } +.sidebar h3.archives { + background: transparent url(archives.gif) top left no-repeat; + width: 130px; + height: 25px; + margin-left:-8px; + + text-indent: 100%; + white-space: nowrap; + overflow: hidden; + } +.sidebar h3.resources { + background: transparent url(resources.gif) top left no-repeat; + width: 130px; + height: 25px; + margin-left:-8px; + + text-indent: 100%; + white-space: nowrap; + overflow: hidden; + } + +.sidebar ul { + margin: 0px; + padding: 0px; + } +.sidebar li { + line-height: 2.5ex; + background: transparent; + display: block; + padding-top: 5px; + margin-bottom: 5px; + list-style-type: none; + } +.sidebar li a:link { + color: #FF3300; + } +.sidebar li a:visited { + color: #FF0000; + } + +.extra1 { + background: transparent; + position: absolute; + top: 40px; + right: 0px; + width: 148px; + height: 110px; + } \ No newline at end of file diff --git a/dom-playground-master/images/archives.gif b/dom-playground-master/images/archives.gif new file mode 100755 index 0000000..f8b3abe Binary files /dev/null and b/dom-playground-master/images/archives.gif differ diff --git a/dom-playground-master/images/menu.gif b/dom-playground-master/images/menu.gif new file mode 100755 index 0000000..cfba7ef Binary files /dev/null and b/dom-playground-master/images/menu.gif differ diff --git a/dom-playground-master/images/resources.gif b/dom-playground-master/images/resources.gif new file mode 100755 index 0000000..3170140 Binary files /dev/null and b/dom-playground-master/images/resources.gif differ diff --git a/dom-playground-master/images/select.gif b/dom-playground-master/images/select.gif new file mode 100755 index 0000000..089cc9d Binary files /dev/null and b/dom-playground-master/images/select.gif differ diff --git a/dom-playground-master/images/tag.gif b/dom-playground-master/images/tag.gif new file mode 100755 index 0000000..145c9f5 Binary files /dev/null and b/dom-playground-master/images/tag.gif differ diff --git a/dom-playground-master/images/trees.jpg b/dom-playground-master/images/trees.jpg new file mode 100755 index 0000000..126ac08 Binary files /dev/null and b/dom-playground-master/images/trees.jpg differ diff --git a/dom-playground-master/index.html b/dom-playground-master/index.html new file mode 100755 index 0000000..1900ca6 --- /dev/null +++ b/dom-playground-master/index.html @@ -0,0 +1,271 @@ + + + + + + CSS Zen Garden: The Beauty of CSS Design + + + + + + + + + + + + + + + + +
+ +
+
+

CSS Zen Garden

+

The Beauty of CSS Design

+
+ +
+

A demonstration of what can be accomplished through CSS-based design. Select any style sheet from the list to + load it into this page.

+

Download the example html file and css file +

+
+ +
+

The Road to Enlightenment

+

Littering a dark and dreary road lay the past relics of browser-specific tags, incompatible DOMs, broken CSS support, and abandoned browsers.

+

We must clear the mind of the past. Web enlightenment has been achieved thanks to the tireless + efforts of folk like the W3C, WaSP, and the major browser creators.

+

The CSS Zen Garden invites you to relax and meditate on the important lessons of the masters. Begin + to see with clarity. Learn to use the time-honored techniques in new and invigorating fashion. + Become one with the web.

+
+
+ +
+
+

So What is This About?

+

There is a continuing need to show the power of CSS. The + Zen Garden aims to excite, inspire, and encourage participation. To begin, view some of the existing + designs in the list. Clicking on any one will load the style sheet into this very page. The HTML remains the same, the only thing that has changed + is the external CSS file. Yes, really.

+

CSS allows complete and total control over the style of a + hypertext document. The only way this can be illustrated in a way that gets people excited is by + demonstrating what it can truly be, once the reins are placed in the hands of those able to create + beauty from structure. Designers and coders alike have contributed to the beauty of the web; we can + always push it further.

+
+ +
+

Participation

+

Strong visual design has always been our focus. You are modifying this page, so strong CSS skills are necessary too, but the example files are + commented well enough that even CSS novices can use them + as starting points. Please see the CSS + Resource Guide for advanced tutorials and tips on working with CSS.

+

You may modify the style sheet in any way you wish, but not the HTML. This may seem daunting at first if you’ve + never worked this way before, but follow the listed links to learn more, and use the sample files as + a guide.

+

Download the sample HTML and CSS to + work on a copy locally. Once you have completed your masterpiece (and please, don’t submit + half-finished work) upload your CSS file to a web server + under your control. Send us a link to an archive of that + file and all associated assets, and if we choose to use it we will download it and place it on our + server.

+
+ +
+

Benefits

+

Why participate? For recognition, inspiration, and a resource we can all refer to showing people how + amazing CSS really can be. This site serves as equal + parts inspiration for those working on the web today, learning tool for those who will be tomorrow, + and gallery of future techniques we can all look forward to.

+
+ +
+

Requirements

+

Where possible, we would like to see mostly CSS + 1 & 2 usage. CSS 3 & + 4 should be limited to widely-supported elements only, or strong fallbacks should be + provided. The CSS Zen Garden is about functional, practical CSS and not the latest bleeding-edge tricks viewable by 2% + of the browsing public. The only real requirement we have is that your CSS validates.

+

Luckily, designing this way shows how well various browsers have implemented CSS by now. When sticking to the guidelines you should see + fairly consistent results across most modern browsers. Due to the sheer number of user agents on the + web these days — especially when you factor in mobile — pixel-perfect layouts may not be + possible across every platform. That’s okay, but do test in as many as you can. Your design + should work in at least IE9+ and the latest Chrome, Firefox, iOS and Android browsers (run by over + 90% of the population).

+

We ask that you submit original artwork. Please respect copyright laws. Please keep objectionable + material to a minimum, and try to incorporate unique and interesting visual themes to your work. + We’re well past the point of needing another garden-related design.

+

This is a learning exercise as well as a demonstration. You retain full copyright on your graphics + (with limited exceptions, see submission guidelines), but we + ask you release your CSS under a Creative Commons + license identical to the one on this site so that others may learn + from your work.

+

By Dave Shea. Bandwidth graciously donated + by mediatemple. Now available: Zen Garden, the book. +

+
+ + + +
+ + + + + +
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/dom-playground-master/index.orig.html b/dom-playground-master/index.orig.html new file mode 100755 index 0000000..c1ab25e --- /dev/null +++ b/dom-playground-master/index.orig.html @@ -0,0 +1,293 @@ + + + + + + CSS Zen Garden: The Beauty of CSS Design + + + + + + + + + + + + + + + + + +
+ +
+
+

CSS Zen Garden

+

The Beauty of CSS Design

+
+ +
+

A demonstration of what can be accomplished through CSS-based design. Select any style sheet from the list to + load it into this page.

+

Download the example html file and css file +

+
+ +
+

The Road to Enlightenment

+

Littering a dark and dreary road lay the past relics of browser-specific tags, incompatible DOMs, broken CSS support, and abandoned browsers.

+

We must clear the mind of the past. Web enlightenment has been achieved thanks to the tireless + efforts of folk like the W3C, WaSP, and the major browser creators.

+

The CSS Zen Garden invites you to relax and meditate on the important lessons of the masters. Begin + to see with clarity. Learn to use the time-honored techniques in new and invigorating fashion. + Become one with the web.

+
+
+ +
+
+

So What is This About?

+

There is a continuing need to show the power of CSS. The + Zen Garden aims to excite, inspire, and encourage participation. To begin, view some of the existing + designs in the list. Clicking on any one will load the style sheet into this very page. The HTML remains the same, the only thing that has changed + is the external CSS file. Yes, really.

+

CSS allows complete and total control over the style of a + hypertext document. The only way this can be illustrated in a way that gets people excited is by + demonstrating what it can truly be, once the reins are placed in the hands of those able to create + beauty from structure. Designers and coders alike have contributed to the beauty of the web; we can + always push it further.

+
+ +
+

Participation

+

Strong visual design has always been our focus. You are modifying this page, so strong CSS skills are necessary too, but the example files are + commented well enough that even CSS novices can use them + as starting points. Please see the CSS + Resource Guide for advanced tutorials and tips on working with CSS.

+

You may modify the style sheet in any way you wish, but not the HTML. This may seem daunting at first if you’ve + never worked this way before, but follow the listed links to learn more, and use the sample files as + a guide.

+

Download the sample HTML and CSS to + work on a copy locally. Once you have completed your masterpiece (and please, don’t submit + half-finished work) upload your CSS file to a web server + under your control. Send us a link to an archive of that + file and all associated assets, and if we choose to use it we will download it and place it on our + server.

+
+ +
+

Benefits

+

Why participate? For recognition, inspiration, and a resource we can all refer to showing people how + amazing CSS really can be. This site serves as equal + parts inspiration for those working on the web today, learning tool for those who will be tomorrow, + and gallery of future techniques we can all look forward to.

+
+ +
+

Requirements

+

Where possible, we would like to see mostly CSS + 1 & 2 usage. CSS 3 & + 4 should be limited to widely-supported elements only, or strong fallbacks should be + provided. The CSS Zen Garden is about functional, practical CSS and not the latest bleeding-edge tricks viewable by 2% + of the browsing public. The only real requirement we have is that your CSS validates.

+

Luckily, designing this way shows how well various browsers have implemented CSS by now. When sticking to the guidelines you should see + fairly consistent results across most modern browsers. Due to the sheer number of user agents on the + web these days — especially when you factor in mobile — pixel-perfect layouts may not be + possible across every platform. That’s okay, but do test in as many as you can. Your design + should work in at least IE9+ and the latest Chrome, Firefox, iOS and Android browsers (run by over + 90% of the population).

+

We ask that you submit original artwork. Please respect copyright laws. Please keep objectionable + material to a minimum, and try to incorporate unique and interesting visual themes to your work. + We’re well past the point of needing another garden-related design.

+

This is a learning exercise as well as a demonstration. You retain full copyright on your graphics + (with limited exceptions, see submission guidelines), but we + ask you release your CSS under a Creative Commons + license identical to the one on this site so that others may learn + from your work.

+

By Dave Shea. Bandwidth graciously donated + by mediatemple. Now available: Zen Garden, the book. +

+
+ + + +
+ + + + + +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/dom-playground-master/js/fix-the-page.js b/dom-playground-master/js/fix-the-page.js new file mode 100755 index 0000000..0e94672 --- /dev/null +++ b/dom-playground-master/js/fix-the-page.js @@ -0,0 +1,77 @@ +/** + * Use this javascript file to fix the page design and layout. + * + * Rules: + * 1) You may not modify the HTML file. + * 2) You may not modify the CSS file. + * + * You can begin by adding the classes mentioned in style.css to + * their appropriate elements in the HTML file. + */ + + + + + + + + + + + + +/** + * Here's the bad news: The resource links are missing from our HTML file. + * The good news: They're here in our JS file as an array of objects. + * + * 1) Use this array of objects to create new tags and append them to a new
  • . + * 2) Then take your new
  • and append it to ul#resourceList + */ +let resources = [ + { + title: "View the source CSS file of the currently-viewed design.", + href: "css/style.css", + innerHTML: "View This Design’s CSS" + }, + { + title: "Links to great sites with information on using CSS.", + href: "http://www.mezzoblue.com/zengarden/resources/", + innerHTML: "CSS Resources " + }, + { + title: "A list of Frequently Asked Questions about the Zen Garden.", + href: "http://www.mezzoblue.com/zengarden/faq/", + innerHTML: "FAQ " + }, + { + title: "Send in your own CSS file.", + href: "http://www.mezzoblue.com/zengarden/submit/", + innerHTML: "Submit a Design" + }, + { + title: "View translated versions of this page.", + href: "http://www.mezzoblue.com/zengarden/translations/", + innerHTML: "Translations" + }, +]; +let resourceList = document.querySelector('ul#resourceList') + +resources.forEach(resource => { + let listItem = document.createElement('li'); + let anchor = document.createElement('a'); + anchor.title = resource.title; + anchor.innerHTML = resource.innerHTML; + anchor.href = resource.href; + listItem.appendChild(anchor); + resourceList.appendChild(listItem); +}); + +let pageWrapper = document.querySelector('body>div') +pageWrapper.className = 'page-wrapper' + +let zenSummary = document.getElementById('zen-summary') +zenSummary.className = 'summary' + +let sidebar = document.querySelector("aside[role='complementary']") +sidebar.className = 'sidebar' + diff --git a/mocking-sponge/.gitignore b/mocking-sponge/.gitignore old mode 100644 new mode 100755 diff --git a/mocking-sponge/README.md b/mocking-sponge/README.md old mode 100644 new mode 100755 diff --git a/mocking-sponge/img/spongebob.jpg b/mocking-sponge/img/spongebob.jpg old mode 100644 new mode 100755 diff --git a/mocking-sponge/index.html b/mocking-sponge/index.html old mode 100644 new mode 100755 diff --git a/mocking-sponge/js/main.js b/mocking-sponge/js/main.js old mode 100644 new mode 100755 diff --git a/tip-calculator-master/.gitignore b/tip-calculator-master/.gitignore old mode 100644 new mode 100755 diff --git a/tip-calculator-master/README.md b/tip-calculator-master/README.md old mode 100644 new mode 100755 diff --git a/tip-calculator-master/css/main.css b/tip-calculator-master/css/main.css old mode 100644 new mode 100755 diff --git a/tip-calculator-master/images/brooke-lark-pGM4sjt_BdQ-unsplash.jpg b/tip-calculator-master/images/brooke-lark-pGM4sjt_BdQ-unsplash.jpg old mode 100644 new mode 100755 diff --git a/tip-calculator-master/images/camila-melim-yHQfZ9TuZn4-unsplash.jpg b/tip-calculator-master/images/camila-melim-yHQfZ9TuZn4-unsplash.jpg old mode 100644 new mode 100755 diff --git a/tip-calculator-master/images/claudia-crespo-ewOrvEa87j4-unsplash.jpg b/tip-calculator-master/images/claudia-crespo-ewOrvEa87j4-unsplash.jpg old mode 100644 new mode 100755 diff --git a/tip-calculator-master/index.html b/tip-calculator-master/index.html old mode 100644 new mode 100755 diff --git a/tip-calculator-master/js/script.js b/tip-calculator-master/js/script.js old mode 100644 new mode 100755 diff --git a/week-1/index.html b/week-1/index.html old mode 100644 new mode 100755 diff --git a/week-3/index.html b/week-3/index.html old mode 100644 new mode 100755 diff --git a/week-3/js/main.js b/week-3/js/main.js old mode 100644 new mode 100755 diff --git a/week-4/css/style.css b/week-4/css/style.css old mode 100644 new mode 100755 diff --git a/week-4/index.html b/week-4/index.html old mode 100644 new mode 100755 diff --git a/week-4/js/main.js b/week-4/js/main.js old mode 100644 new mode 100755 diff --git a/week-5/bean.js b/week-5/bean.js old mode 100644 new mode 100755 diff --git a/week-5/index.html b/week-5/index.html old mode 100644 new mode 100755 diff --git a/week-5/minimum.js b/week-5/minimum.js old mode 100644 new mode 100755 diff --git a/week-5/recursion.js b/week-5/recursion.js old mode 100644 new mode 100755 diff --git a/week-6/index.html b/week-6/index.html old mode 100644 new mode 100755 index cc3e0c9..0249f41 --- a/week-6/index.html +++ b/week-6/index.html @@ -1,12 +1,12 @@ - - - - - - MDN Object Tutoral - - -

    look in the console thanks

    - - + + + + + + MDN Object Tutoral + + +

    look in the console thanks

    + + \ No newline at end of file diff --git a/week-6/js/main.js b/week-6/js/main.js old mode 100644 new mode 100755 index a84f8ce..28930e7 --- a/week-6/js/main.js +++ b/week-6/js/main.js @@ -1,17 +1,17 @@ -function Person(first, last, age, gender, interests) { - this.name = { - first : first, - last : last - }; - this.age = age; - this.gender = gender; - this.interests = interests; - this.bio = function() { - alert(this.name.first + ' ' + this.name.last + ' is ' + this.age + ' years old. He likes ' + this.interests[0] + ' and ' + this.interests[1] + '.'); - }; - this.greeting = function() { - alert('Hi! I\'m ' + this.name.first + '.'); - }; -} - -let person1 = new Person('Bob', 'Smith', 32, 'male', ['music', 'skiing']); +function Person(first, last, age, gender, interests) { + this.name = { + first : first, + last : last + }; + this.age = age; + this.gender = gender; + this.interests = interests; + this.bio = function() { + alert(this.name.first + ' ' + this.name.last + ' is ' + this.age + ' years old. He likes ' + this.interests[0] + ' and ' + this.interests[1] + '.'); + }; + this.greeting = function() { + alert('Hi! I\'m ' + this.name.first + '.'); + }; +} + +let person1 = new Person('Bob', 'Smith', 32, 'male', ['music', 'skiing']); diff --git a/week-6/js/reverse.js b/week-6/js/reverse.js old mode 100644 new mode 100755 index 2c0696f..83104b1 --- a/week-6/js/reverse.js +++ b/week-6/js/reverse.js @@ -1,21 +1,21 @@ -function reverseArray(array) { - let arrayNew = [] - for (let index = array.length- 1; index >=0 ; index--) { - const element = array[index]; - arrayNew.push(element); - } - return arrayNew -} - -function reverseArrayInPlace(array) { - let lastIndex = array.length - 1 - for (let index = 0; index < (lastIndex / 2); index++) { - const element = array[index]; - array[index] = array[lastIndex-index] - array[lastIndex-index] = element; - } -} -console.log(reverseArray(["A", "B", "C"])); -let arrayValue = [1, 2, 3, 4, 5]; -reverseArrayInPlace(arrayValue); +function reverseArray(array) { + let arrayNew = [] + for (let index = array.length- 1; index >=0 ; index--) { + const element = array[index]; + arrayNew.push(element); + } + return arrayNew +} + +function reverseArrayInPlace(array) { + let lastIndex = array.length - 1 + for (let index = 0; index < (lastIndex / 2); index++) { + const element = array[index]; + array[index] = array[lastIndex-index] + array[lastIndex-index] = element; + } +} +console.log(reverseArray(["A", "B", "C"])); +let arrayValue = [1, 2, 3, 4, 5]; +reverseArrayInPlace(arrayValue); console.log(arrayValue); \ No newline at end of file diff --git a/week-6/js/sum.js b/week-6/js/sum.js old mode 100644 new mode 100755 index 91d5e6d..5a90075 --- a/week-6/js/sum.js +++ b/week-6/js/sum.js @@ -1,20 +1,20 @@ -function range(start, end, step) { - let arr = [] - if (step > 0){ - for (let index = start; index <= end; index += step) { - arr.push(index) - } - } else if (step < 0) - for (let index = start; index >= end; index += step) { - arr.push(index) - } else return "Err" - return arr -} - -function sum(array) { - let sum = 0; - array.forEach(item => { - sum += item - }); - return sum +function range(start, end, step) { + let arr = [] + if (step > 0){ + for (let index = start; index <= end; index += step) { + arr.push(index) + } + } else if (step < 0) + for (let index = start; index >= end; index += step) { + arr.push(index) + } else return "Err" + return arr +} + +function sum(array) { + let sum = 0; + array.forEach(item => { + sum += item + }); + return sum } \ No newline at end of file diff --git a/week-6/reverse.html b/week-6/reverse.html old mode 100644 new mode 100755 index 5db4cb1..9cef66a --- a/week-6/reverse.html +++ b/week-6/reverse.html @@ -1,11 +1,11 @@ - - - - - - Reversing an array - - - - + + + + + + Reversing an array + + + + \ No newline at end of file diff --git a/week-6/sum.html b/week-6/sum.html old mode 100644 new mode 100755 index a2b7824..c5883a6 --- a/week-6/sum.html +++ b/week-6/sum.html @@ -1,11 +1,11 @@ - - - - - - Sum of a Range - - - - + + + + + + Sum of a Range + + + + \ No newline at end of file