ga-wdi-boston / ruby-vs-js-hash-dictionary Goto Github PK
View Code? Open in Web Editor NEWLicense: Other
License: Other
This is how rails handles method config options.
I haven't found many examples in plain ruby, other than [g]sub:
'bar baz'.gsub /b[^[:space:]]+/, 'bar' => 'snafu', 'baz' => 'fubar'
# => "snafu fubar"
The thing to note is that the terminal hash parameter isn't surrounded by curly braces.
e.g.
counts = Hash.new(0) # {}
counts[:dog] +=1 # 1
counts # {:dog=>1}
This provides a good contrast to how hashes (objects) behave in JavaScript (no default possible).
Possibly confusing.
git remote add js-template [email protected]:ga-wdi-boston/js-template
git fetch js-template
git checkout js-template/master -- .jshintrc .jshintignore .jscsrc
The code-alongs could be a little more well-defined unless the idea is just to SHOW the demonstration block, and then code-the-same-thing-along. I think I just got off track because I started free-styling and a little more structure might have helped me stay on track.
When .prepend
is executed on consultant[:surname]
, it modifies the hash. The README.md states that it doesn't modify, just returns the change. Correction needed to show that the hash will be modified from the .prepend
I see that the example of a consultant and his/her fluctuating weight has been part of this lesson since (at least) cohort 10. Would it be possible to move away from this, and use a different metaphor?
For example, I was thinking of using an "apartment" as the metaphor, which would have set number of rooms, number of roommates/pets, which would connect this new thing to what we had previously done in the JS lessons, without explicitly doing a comparison to JS.
Looking forward to your input, @gaand, @jrhorn424
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.