I'm a JS Subject Matter Expert (SME) that has spent the past few years spearheading curricula and teaching initiatives at colleges and bootcamps, in person and virtually.
Pretty sure I got this technique where we can use 'console.log' inside an arrow fxn. from an episode of @syntaxfm But...doesn't appear that TS is 🆒 with this. Any tips?
12:43 PM - 31 Jan 2021
Any suggestions on getting this approach to work in TS?
Really nice!
And also, using an object into
console.logprints both the variable name and its value, like:console.log({a, b})Thank you! This is a really great point!
Ryan just informed me that TypeScript knows console.log is void function so you need to cast it to any.
Thanks again.
That's wicked smart
Great tip Ryan!
That's super clever! I log in functions like this all the time, but I add braces and convert to an explicit return
Thats nice share
Very helpful but why does console.log evaluate to falsy and why does it still log when false?
Any suggestions on getting this approach to work in TS?
For Typescript, I think this is easier (a,b) => (console.log(a), a+b)
The comma will only return the last expression-
really helpful