Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialrichimon richisin
304 Pointsabout the sorting in JavaScript
Hello, I saw how is the syntaxis of an object and the array. But I found in other place this kind of syntaxis: $startOptions: ( size: 5px, width: 70, height: 70,
loops: 10, twists: 10,
minHue: 360, maxHue: 360 );
Are this an array too? Since array syntaxis is like this var cars = ["Saab", "Volvo", "BMW"] Are this an object? I remember that the object has the syntax as follows: person={ size: '5px', width: 70, height: 70,
loops: 10, twists: 10,
minHue: 360, maxHue: 360 };
But in this example I found it uses parentesis and the 5px is not between quotations...
Thanks
2 Answers
Steven Parker
231,271 PointsYour first example is not an array. But it also doesn't follow the convention for objects, for the reasons you pointed out.
My first guess would be that this exampe is not JavaScript code. Please provide a link to the place where you saw this, and I'll give you a more detailed answer.
richimon richisin
304 Pointsoh well you're right. It's SCSS. Here is the link https://codepen.io/ruberoctavio/pen/RejjVw
Also, I don't understand this part: @function hueRange($shadow, $hue) { $minHue: call($shadow, minHue); $maxHue: call($shadow, maxHue); @return $hue / 360 * ($maxHue - $minHue) + $minHue; }
As you can see $minHue and $maxHue uses a call method (I couldn't find details about it). And, the function asks for 2 arguments but $shadow is not used anywhere..
I quite donΒ΄t understand the logic of it...
Steven Parker
231,271 PointsI added a comment to my original answer.
Steven Parker
231,271 PointsSteven Parker
231,271 PointsI don't know much about SCSS/Sass, but I'd guess that the argument passed to the parameter "$shadow" represents another function that will be dynamically invoked by the "call" method.
There are Sass courses here if you're interested in learning more.