Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Search - "spread operator"
-
- They had an error in production
- Almost one year without looking in this codebase
- Last backend dev in the building
- 1h debugging and reading the Stack Trace
- Had a feeling, and changed the place of a single asterisk (groovy's spread operator in the wrong place)
- Now everything is working, our PM is happy, and the client didn't even noticed
- Probably the shortest commit I've ever done
It was a good day :D -
ARRAY LIKE OBJECTS
Long story short, i am fiddling a bit around with javascripts, a json object a php script created and encountered "array-like" objects. I tried to use .forEach and discovered it doesnt work on those.
Easy easy, there is always Array.from()..just..it doesnt work, well it does work for one subset called ['data'] which contains the actual rows i generate a table from, but for the ['meta'] part of the json object it just returns a length 0 object..me no understanderino
at least something cheered me up when researching, it was an article with the quote: "Finally, the spread operator. It’s a fantastic way to convert Array-like objects into honest-to-God arrays."
I like honest-to-God arrays..or in my case honest to Fortuna..doesnt solve my problem though2 -
When you hear a conversation where a developer tries to explain difference between JavaScript spread operator and an ellipsis to a random person they walked past.
20min now... (Ellipsis is intentional here) -
Quick JS tip
If you want to split a string into characters, you can use the ES6 spread operator
If you have
const name = 'react-dev'
You can just spread it like this:
const charsInName = [...name]5 -
gulp started throwing premature close on useref:dist yesterday
said it was on a dependency
spent whole afternoon checking gulp issues and reviewing dependencies
as it turns out, it was nothing even remotely related to the error message
it was a spread operator used to merge objects
why must the Lord test me like that -
What’s a practical use case of the ES6 spread operator? I’m pretty fresh and would just like to see a real world example where you would need to destructure some array values and apply them to function Params.3