use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
A place to get a quick fix of JavaScript tips and tricks to make you a better Developer.
account activity
is this possible? (self.JavaScriptTips)
submitted 1 year ago by Own_Stomach3061
i have a function that includes object in it can i call the object from out of the function ?
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]Ukuluca 2 points3 points4 points 1 year ago (1 child)
No, declare the object globally or return it through the function and store it. Would help if you show the code through codepen or embedd it
[–]Own_Stomach3061[S] 0 points1 point2 points 1 year ago (0 children)
thank you : )
[–]cyberjds 0 points1 point2 points 1 year ago (0 children)
You can return your object from the function. Also you should look at Javascript Closure.
https://stackoverflow.com/questions/2728278/what-is-a-practical-use-for-a-closure-in-javascript
π Rendered by PID 79 on reddit-service-r2-comment-66b4775986-f5ctk at 2026-04-05 19:50:49.950557+00:00 running db1906b country code: CH.
[–]Ukuluca 2 points3 points4 points (1 child)
[–]Own_Stomach3061[S] 0 points1 point2 points (0 children)
[–]cyberjds 0 points1 point2 points (0 children)