Ranter
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
Comments
-
musician6656yAlso very useful for quickly console logging things bei in inline arrow functions
console.log(...) || something -
musician6656y@ScriptCoded console.log is a void method and is falsy because of it. So you say false || something which results to something.
For example react:
const a = props => console.log(props)|| <h1>hi</h1>
Edit: yes it runs both -
-
@musician Oh, so you can put it inline! That's really smart, thanks!
@ePinikion I thought that was ES5. And this is what I do for money... -
@ScriptCoded ES6 = ECMA 2015 and thats where it was implemented as you can see here https://developer.mozilla.org/docs/...
function foo (bar){
bar = bar || false
}
Before ES6, still using
random
wk134
javascript