├── README.md
└── assignments
├── index.html
├── lambda-classes.js
└── prototype-refactor.js
/README.md:
--------------------------------------------------------------------------------
1 | # JavaScript IV
2 |
3 | This challenge focuses on classes in JavaScript using the new `class` keyword.
4 |
5 | ## Set Up The Project With Git
6 |
7 | **Follow these steps to set up and work on your project:**
8 |
9 | * [ ] Create a forked copy of this project.
10 | * [ ] Add your project manager as collaborator on Github.
11 | * [ ] Clone your OWN version of the repository (Not Lambda's by mistake!).
12 | * [ ] Create a new branch: git checkout -b ``.
13 | * [ ] Implement the project on your newly created `` branch, committing changes regularly.
14 | * [ ] Push commits: git push origin ``.
15 |
16 | **Follow these steps for completing your project.**
17 |
18 | * [ ] Submit a Pull-Request to merge Branch into master (student's Repo). **Please don't merge your own pull request**
19 | * [ ] Add your project manager as a reviewer on the pull-request
20 | * [ ] Your project manager will count the project as complete by merging the branch back into master.
21 |
22 | ## Assignment Description
23 |
24 | You already pretty much know all about classes but you're used to seeing them built in the following context:
25 |
26 | ```js
27 | function Person(personAttributes) {
28 | this.name = personAttributes.name;
29 | this.age = personAttributes.age;
30 | this.location = personAttributes.location;
31 | }
32 |
33 | const fred = new Person({
34 | name: 'Fred',
35 | age: 37,
36 | location: 'Bedrock'
37 | });
38 | ```
39 |
40 | * Because none of the above code is new, you're about to see your world get much much easier when dealing with Object Creation and Classical Inheritance as it pertains to JavaScript.
41 | * The Class Keyword makes this SO MUCH EASIER!
42 | * **Fork** and clone this repository.
43 | * **Complete** all of the exercises found in the assignment files.
44 |
45 | ## `prototype-refactor` - Take existing code and make it modern.
46 |
47 | * You're going to work with your prototypes assignment you built out yesterday.
48 | * `Challenge:` **Convert** all of your constructors into ES6 Classes using the `class` and `extends` keywords. You should be able to run your same logs and they should build out the proper expected behaviors.
49 |
50 | ## `lambda-classes` - We need a roster of Lambda School personnel. Build it!
51 |
52 | * We have a school to build here! This project will get you used to thinking about classes in JavaScript and building them from a brand new data set.
53 | * Lambda personnel can be broken down into three different types of `people`.
54 | * **Instructors** - extensions of Person
55 | * **Students** - extensions of Person
56 | * **Project Managers** - extensions of Instructors
57 | * **IMPORTANT** - You'll need to create 2 - 3 objects for each class and test them according to their unique Attributes. For example:
58 |
59 | ```js
60 | const fred = new Instructor({
61 | name: 'Fred',
62 | location: 'Bedrock',
63 | age: 37,
64 | favLanguage: 'JavaScript',
65 | specialty: 'Front-end',
66 | catchPhrase: `Don't forget the homies`
67 | });
68 | ```
69 |
70 | #### Person
71 |
72 | * First we need a Person class. This will be our `base-class`
73 | * Person receives `name` `age` `location` all as props
74 | * Person receives `speak` as a method.
75 | * This method logs out a phrase `Hello my name is Fred, I am from Bedrock` where `name` and `location` are the object's own props
76 |
77 | #### Instructor
78 |
79 | * Now that we have a Person as our base class, we'll build our Instructor class.
80 | * Instructor uses the same attributes that have been set up by Person
81 | * Instructor has the following unique props:
82 | * `specialty` what the Instructor is good at i.e. 'redux'
83 | * `favLanguage` i.e. 'JavaScript, Python, Elm etc.'
84 | * `catchPhrase` i.e. `Don't forget the homies`
85 | * Instructor has the following methods:
86 | * `demo` receives a `subject` string as an argument and logs out the phrase 'Today we are learning about {subject}' where subject is the param passed in.
87 | * `grade` receives a `student` object and a `subject` string as arguments and logs out '{student.name} receives a perfect score on {subject}'
88 |
89 | #### Student
90 |
91 | * Now we need some students!
92 | * Student uses the same attributes that have been set up by Person
93 | * Student has the following unique props:
94 | * `previousBackground` i.e. what the Student used to do before Lambda School
95 | * `className` i.e. CS132
96 | * `favSubjects`. i.e. an array of the student's favorite subjects ['Html', 'CSS', 'JavaScript']
97 | * Student has the following methods:
98 | * `listsSubjects` a method that logs out all of the student's favoriteSubjects one by one.
99 | * `PRAssignment` a method that receives a subject as an argument and logs out that the `student.name has submitted a PR for {subject}`
100 | * `sprintChallenge` similar to PRAssignment but logs out `student.name has begun sprint challenge on {subject}`
101 |
102 | #### Project Manager
103 |
104 | * Now that we have instructors and students, we'd be nowhere without our PM's
105 | * ProjectManagers are extensions of Instructors
106 | * ProjectManagers have the following unique props:
107 | * `gradClassName`: i.e. CS1
108 | * `favInstructor`: i.e. Sean
109 | * ProjectManagers have the following Methods:
110 | * `standUp` a method that takes in a slack channel and logs `{name} announces to {channel}, @channel standy times!`
111 | * `debugsCode` a method that takes in a student object and a subject and logs out `{name} debugs {student.name}'s code on {subject}`
112 |
113 | #### Stretch Problem
114 |
115 | * Extend the functionality of the Student by adding a prop called grade and setting it equal to a number between 1-100.
116 | * Now that our students have a grade build out a method on the Instructor (this will be used by _BOTH_ instructors and PM's) that will randomly add or subtract points to a student's grade. _Math.random_ will help.
117 | * Add a graduate method to a student.
118 | * This method, when called, will check the grade of the student and see if they're ready to graduate from Lambda School
119 | * If the student's grade is above a 70% let them graduate! Otherwise go back to grading their assignments to increase their score.
120 |
--------------------------------------------------------------------------------
/assignments/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | JS IV
9 |
10 |
11 |
12 |
13 |
14 |
15 | JS IV - Check your work in the console!
16 |
17 |
--------------------------------------------------------------------------------
/assignments/lambda-classes.js:
--------------------------------------------------------------------------------
1 | // CODE here for your Lambda Classes
2 |
--------------------------------------------------------------------------------
/assignments/prototype-refactor.js:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | Prototype Refactor
4 |
5 | 1. Copy and paste your code or the solution from yesterday
6 |
7 | 2. Your goal is to refactor all of this code to use ES6 Classes. The console.log() statements should still return what is expected of them.
8 |
9 | */
10 |
--------------------------------------------------------------------------------