You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
objects-arrays.js
lines 10-29. These are not objects. Remember that in JS, objects take the form const objectName ={ key1:value1, key2:value2, ..., keyn:valuen }
So for instance, if I wanted to make an object 'brontosaurus', I would do something like
`const brontosaurus = {
diet: 'herbivorous',
weight: '15 tons',
length: '22m'
}`
Lines 32-64, you were trying to access different properties of objects. Since you hadn't actually created any objects, you couldn't access them. In the places you tried, you used something that looked like this: const Period = function (tyrannosaurus){ return tyrannosaurus.Period; }
There are several problems here. First, the const keyword is used for variables in JS. You started what would normally be a variable name with a capital letter. In JS, the convention is that classes start with a capital letter, and variables start with a lowercase letter. Secondly, you appear to be trying to use a function to access the period of tyrannosaurus. The basic function would work, but because you didn't actually create an object 'tyrannosaurus', you could not return a property 'Period' from 'tyrannosaurus'. (Again, when you do create a property for an object, you should avoid starting the property name with a capital letter.
Request 1 (arrays exercises):
line 85-87. You were not supposed to hard-code an array containing the universities, but rather loop over the provided array graduates, and from each graduate object, access the university property, and push that to an empty array.
line 88: you tried calling a function called 'newFunction()', but you hadn't declared that function anywhere in your code, so when you tried calling it, it couldn't do anything except throw an error.
lines 90-92: this function universities has several problems. The first is you didn't call it anywhere, so even if the function had done what you expected, it wouldn't have been able to actually do anything in runtime. Secondly, if the function was meant to sort the universities in your array, you would have needed a parameter to accept the array. According to your explanation yesterday, the parameters a,b were placeholders for strings. If you don't have a parameter for the array, you cannot loop over the array to ensure your function is being applied to all the strings in the array. Finally, it is still unclear to me how your return statement would actually accomplish the sorting of strings, since you didn't include logic for handling the returned value from the nested ternary operators to ensure actual sorting occurred. Also, for complex things like sorting, at this stage in your programming journey, I'd recommend looking at built-in functions before attempting to write code. It saves time and allows you to be more productive.
Request 2:
You hard-coded the array that was supposed to be generated by looping over the array 'graduates' and performing operations to access the needed properties of each object in that array.
Request 3:
You initialized an empty array, and then tried to invoke the array on an object 'sort', which wasn't declared anywhere. Again, to achieve this objective, you were required to loop over the provided array 'graduates', and use your knowledge of arrays and objects to access the required properties, which were supposed to then be concatenated into a string, which would be pushed onto a new array.
- advanced array methods
None attempted.
Request 4.
prototypes.js
-not started
classes.js
-not started
functions.js
-not started
MVP not complete. 1
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.