Skip to content
Advertisement

How do I pass a function parameter into a lambda function subsequently

I am trying to pass in the timeframe='month' parameter into my function. I tried applying with lambda function but it doesn’t seem to work.

JavaScript

Any advice on how to apply my timeframe inside? I want to able to extract the day, month or year with a function.

Advertisement

Answer

you can do that by using the dunder method __getattribute__ like so:

JavaScript
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement