Head of Engineering at Friday Finance, Vue.js Community Partner, Senior UI/UX Consultant, Master in Production Engineering, MBA in IT Management, Technologist in Data Processing, MCP and MCPD.
Since line breaks are optional in JavaScript, any code can be one line if you want to. 🤣
Ok, jokes aside, I understand one liner functions have appeal with developers, since Functional Programming is receiving full love nowadays.
So if anyone here needs to convert browser's rgb string to hex: stackoverflow.com/a/3627747/424498. This way you can directly send the result of a getComputedStyle(someElement).backgroundColor call to the one line function and receive the hex string as result.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Since line breaks are optional in JavaScript, any code can be one line if you want to. 🤣
Ok, jokes aside, I understand one liner functions have appeal with developers, since Functional Programming is receiving full love nowadays.
So if anyone here needs to convert browser's rgb string to hex: stackoverflow.com/a/3627747/424498. This way you can directly send the result of a
getComputedStyle(someElement).backgroundColor
call to the one line function and receive the hex string as result.