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 4324396
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T09:07:37+00:00 2026-05-21T09:07:37+00:00

Example: console.log(myobject[‘media$group’]); outputs undefined console.log(myobject[‘media\$group’]); outputs expected value What’s the deal? I ran into

  • 0

Example:

console.log(myobject['media$group']);

outputs undefined

console.log(myobject['media\$group']);

outputs expected value

What’s the deal? I ran into this when using youtube’s API.

EDIT:

I’m confused by many of you saying it works, so I will post more info because perhaps I’m missing something stupid.

Here’s the code I’m running:

console.log(feed);
console.log(feed["media$group"]["media$thumbnail"]);

Here’s the object from the first log cut\pasted from firebug:

author
    [Object { name={...}, uri={...}}]

category
    [Object { scheme="http://schemas.google.com/g/2005#kind", term="http://gdata.youtube.com/schemas/2007#video"}, Object { scheme="http://gdata.youtube.co...mas/2007/categories.cat", term="Tech", label="Science & Technology"}, Object { scheme="http://gdata.youtube.com/schemas/2007/keywords.cat", term="google"}, 10 more...]

content
    Object { $t="The Google Doodle team ...googleblog.blogspot.com", type="text"}

gd$comments
    Object { gd$feedLink={...}}

gd$rating
    Object { average=4.77813, max=5, more...}

id
    Object { $t="http://gdata.youtube.co.../api/videos/3NGSU2PM9dA"}

link
    [Object { rel="alternate", type="text/html", href="http://www.youtube.com/...A&feature=youtube_gdata"}, Object { rel="http://gdata.youtube.co...as/2007#video.responses", type="application/atom+xml", href="http://gdata.youtube.co...s/3NGSU2PM9dA/responses"}, Object { rel="http://gdata.youtube.co...emas/2007#video.related", type="application/atom+xml", href="http://gdata.youtube.co...eos/3NGSU2PM9dA/related"}, 2 more...]

media$group
    Object { media$category=[1], media$content=[3], more...}

published
    Object { $t="2011-04-14T00:31:33.000Z"}

title
    Object { $t="Charlie Chaplin Google Doodle", type="text"}

updated
    Object { $t="2011-04-15T23:14:58.000Z"}

yt$statistics
    Object { favoriteCount="2539", viewCount="0"}

And here’s the error from the second console.log:

feed.media is undefined
[Break On This Error] console.log(feed["media"]["media"]); 
  • 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-21T09:07:37+00:00Added an answer on May 21, 2026 at 9:07 am

    'media\$group' and 'media$group' are equal since \$ is not a known escape sequence and thus turns into $.

    So the field simply got defined between your two calls.

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

Sidebar

Related Questions

For example suppose I have var myVar; If I do console.log((myVar != undefined) &&
For example suppose I have the following two functions function a(param1) { console.log(param1); }
direct console to ok.log, and errors to error.log for example
Take a look at the example here: http://www.brianhare.com/physics/so.html Take a look at console.log where
Simple example: for (var i = 0; i < 10; ++i) { console.log(i); //
Sometimes I write scripts without any filename extension. For example: #!/usr/bin/env node console.log('hello world!');
When I edit production code (little fixes) I want to add console.log for example,
Code example: var Events = $({}); Events.on('myCustomEvent', function(){ console.log('myCustomEvent 1') }) Events.trigger('myCustomEvent'); // I
When I call set timeout it returns a number, for example > setTimeout(function(){ console.log('done');
The basic example: var b = 10; var c = b; b++; console.log(b,c); >>

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.