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

  • SEARCH
  • Home
  • 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 6022867
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T03:55:15+00:00 2026-05-23T03:55:15+00:00

window[objref] does not work self[objref] does not work either Here is jsfiddle . Here

  • 0

window[objref] does not work
self[objref] does not work either

Here is jsfiddle.

Here is the code:

var bob = {
    n: {},
    y: {
        somekey: 12,
        oo: 'yah',
        pop: {
            t: 36
        }
    },
    m: function() {},
    l: 'hi'
};


function membersOf(s) {

    //var o = window[s]; // returns false false
    // var o = self[s]; // returns false false
    var o = s; // returns ["0", "1", "2", "3", "4"] ["somekey", "oo", "pop"]

    var ret_array = [];
    for (var p in o) {
        if (o[p] != o.constructor.prototype[p]) {
            ret_array.push(p);
        }
    }
    if (ret_array.length === 0) {
        return false;
    } else {
        return ret_array;
    }
}

var ref = 'bob.y';
var byname = membersOf(ref);
var byval = membersOf(bob.y);
console.log(byname, byval);
  • 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-23T03:55:15+00:00Added an answer on May 23, 2026 at 3:55 am

    Have you tried var byval = membersOf(eval(ref)); ?

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

Sidebar

Related Questions

Window.open javascript function is not working in Mozilla, but working in other browsers, here
window.setInterval(function(){ $('#Notify-Bar').html('a new notification'); }, 5000); Did not work on IE, however works fine
window.location.href redirects the browser to stackoverflow.com when the button is clicked, but does not
window.onmessage = ... window.postMessage('1', '*'); window.postMessage('2', '*'); Does postMessage ( http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#queue-a-task ) guarantee the
The window pops up below the variable, and obscures the code I want to
I've been using Window Home Server for my backups here at home for most
window.localStorage.setItem(Georgia,Atlanta) var x=window.localStorage.getItem(Georgia) I have a list of 50 states and the largest city
window.global_array = new Array(); window.example = function() { var x = new Object(); x['test_property']
window.scrollBy is not working on the following page http://www.resident.co.il/aspx/places.aspx?t=4&a=1 Any idea what can be
$(window).load(function(){ alert(typeof $.fn.init_deps); }); $(document).ready(function(){ /* Departments switcher */ $.fn.init_deps = function(s){ var o

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.