Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6208667
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T05:50:49+00:00 2026-05-24T05:50:49+00:00

for ( var i in this ) { console.log(i); } With this loop, I

  • 0
for ( var i in this ) { console.log(i); }

With this loop, I iterate over all properties of an object. Is it possible to find what local/closure variables exist?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T05:50:50+00:00Added an answer on May 24, 2026 at 5:50 am

    No, there’s no way to examine the contents of a scope, because there’s no way to get a handle to it. (The global scope is excepted, because there are ways of getting a handle to it.)

    What I mean by that is that there’s no way to get the runtime to give you a reference to the scope as if it were a JavaScript object. Thus, there’s no way to explore the properties; there’s nothing for the right-hand side of a “for … in” loop, in other words.

    edit — if one could do this, it would allow for some interesting coding techniques. One could write utility functions, like the new-ish “.bind()” method on the Function prototype, so that the function returned would be able to check for certain special variables in the closure scope, for debugging or logging or other purposes. Thus services that manufacture functions could do some more “powerful” things based on the nature of the client environment. (I don’t know of a language that would allow that.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

See this code: var jsonString = '{id:714341252076979033,type:FUZZY}'; var jsonParsed = JSON.parse(jsonString); console.log(jsonString, jsonParsed); When
var Dog = function() { var _instance = 'hello world'; return function() { console.log(this._instance);
this.someArray = [1,2,3,4,5] for(var i in this.someArray){console.log(this.someArray[i]);} It not only loops through the array
I have an object which has inner objects and properties defined like this: var
I'm trying to find an easy way to loop (iterate) over an array to
I've got this code... function disableSheets(){ console.log(document.styleSheets.length); var c = document.styleSheets.length; for(var i=0;i<c;i++){ console.log(document.styleSheets[i]);
I have a loop kind of like this var lastUpdateTime = (new Date()).getTime(), diffTime
I need to create an array of object literals like this: var myColumnDefs =
Im trying to loop through a json files' object array to access its variables'
I have this function (sample here: http://jsbin.com/emabe4/ ) var a=[]; var log = document.getElementById('log');

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.