This project was made by Renata and Minh.
This is a project made by Renata by Thinkful's React checkpoint 18 entitled: Organizing Your React Code.
- Noteful: GitHub
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const objectA = { | |
| id: 2, | |
| name: 'Jane Doe', | |
| age: 34, | |
| city: 'Chicago', | |
| }; | |
| const objectB = { | |
| id: 3, | |
| age: 33, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // you can pass in `scratchData` to test out `findByid` | |
| // your function | |
| const scratchData = [ | |
| { id: 22, foo: 'bar' }, | |
| { id: 28, foo: 'bizz' }, | |
| { id: 19, foo: 'bazz' }, | |
| ]; | |
| function findById(items, idNum) { | |
| return items.find(example => example.id === idNum); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const studentData = [ | |
| { | |
| name: 'Tim', | |
| status: 'Current student', | |
| course: 'Biology', | |
| }, | |
| { | |
| name: 'Sue', | |
| status: 'Withdrawn', | |
| course: 'Mathematics', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Modify the updateObject function (which takes a single argument (obj)) so that it adds the following key/value pairs to obj and returns it: | |
| // foo => 'foo' | |
| // bar => 'bar' | |
| // bizz => 'bizz' | |
| // bang => 'bang' | |
| function updateObject(obj) { | |
| obj.foo = 'foo'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // In this drill, you need to write code for the createMyObject function so that it returns an object with the following key value pairs: | |
| // foo => 'bar' | |
| // answerToUniverse => 42 | |
| // olly olly => 'oxen free' | |
| // sayHello => a function that returns the string 'hello' | |
| function createMyObject() { | |
| return { | |
| foo: 'bar', |
NewerOlder