learn-co-curriculum / fewpjs_destructuring_assignment Goto Github PK
View Code? Open in Web Editor NEWLicense: Other
License: Other
I found test #8 in the lab quite difficult to do mainly because the reading on destructuring with objects and nested objects in the lesson wasn't very clear. Specifically, it does not state that the values inside of the const
for the destructuring objects have to exactly match the key names in those object. While the examples do use the exact key names, it is not explicitly stated that it has to be done this way so the reader doesn't really know if this was intentional or just a coincidence. What really makes this even more confusing for a first-timer (like myself) is that the lab then goes on to talk about destructuring with arrays where the variable names in the const
can be arbitrary since they refer to the index numbers. A sentence or two stating that the variable names in the const
need to match the key names in the objects that are being deconstructed would be very helpful.
Also, it was not clear to me that I didn't have to account for unused object keys in my deconstructor like you have to do with arrays. I think just a little more clarity on this would be worthwhile even if it lengthens the reading a bit.
#staff
In the section "Destructuring Assignment with Strings", the code snippet defines a variable which it doesn't end up using. This snippet would be more effective if it did utilize the variable it defines.
Here's the snippet, which defines dogsName on the first line and should but doesn't reference on the second line:
const dogsName = 'Sir Woody BarksALot'
const [title, firstName, lastName] = 'Sir Woody BarksALot'.split(' ')
console.log(title, firstName, lastName) // Sir Woody BarksALot
The same goes for the snippet immediately after.
Additionally, in index.js
, step number 8 asks "Use destructuring to assign songs 2 and 4, and Kermit's job and partner" but the spec checks for these variables as well as color.
don't run npm audit fix or npm audit - Anonymous Tech Coach
I am using the WSL terminal when I run learn for the test suites. I receive this error:
Traceback (most recent call last):
11: from /home/jcobian/.rvm/gems/ruby-2.6.1/bin/ruby_executable_hooks:24:in <main>' 10: from /home/jcobian/.rvm/gems/ruby-2.6.1/bin/ruby_executable_hooks:24:in
eval'
9: from /home/jcobian/.rvm/gems/ruby-2.6.1/bin/learn-test:23:in <main>' 8: from /home/jcobian/.rvm/gems/ruby-2.6.1/bin/learn-test:23:in
load'
7: from /home/jcobian/.rvm/gems/ruby-2.6.1/gems/learn-test-2.6.1/bin/learn-test:68:in <top (required)>' 6: from /home/jcobian/.rvm/gems/ruby-2.6.1/gems/learn-test-2.6.1/lib/learn_test/runner.rb:20:in
run'
5: from /home/jcobian/.rvm/gems/ruby-2.6.1/gems/learn-test-2.6.1/lib/learn_test/runner.rb:20:in fork' 4: from /home/jcobian/.rvm/gems/ruby-2.6.1/gems/learn-test-2.6.1/lib/learn_test/runner.rb:21:in
block in run'
3: from /home/jcobian/.rvm/gems/ruby-2.6.1/gems/learn-test-2.6.1/lib/learn_test/runner.rb:44:in report_and_clean' 2: from /home/jcobian/.rvm/gems/ruby-2.6.1/gems/learn-test-2.6.1/lib/learn_test/reporter.rb:13:in
report'
1: from /home/jcobian/.rvm/gems/ruby-2.6.1/gems/learn-test-2.6.1/lib/learn_test/reporter.rb:47:in report' /home/jcobian/.rvm/gems/ruby-2.6.1/gems/learn-test-2.6.1/lib/learn_test/strategies/mocha.rb:42:in
results': undefined method `[]' for nil:NilClass (NoMethodError)
It runs fine at first by this I mean it'll work then out of nowhere it gives me this error. This is not the first time I've into this issue, the first time I deleted the forked copy and re-forked. One of my cohort members than ran into the same issue and found a solution:
Run
rm -rf node_modules
Then run
npm install node
This worked the first couple of times after I kept running into this issue but now it's not working and I had to revert back to deleting the forked repo and forking it again.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.