0

I don't understand why I get video_data = {link: "example"} instead of video_data = {123: "example"}? How I can fix it?

var video_data = {};
var get_info = function(link) {
  video_data.link = data.response;
};

get_info(123);
rel1x
  • 2,351
  • 4
  • 34
  • 62
  • 1
    `video_data[link] = data.response;` – Pointy Mar 04 '15 at 16:41
  • 1
    I recommend to the read the [**MDN JavaScript tutorial about objects**](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Working_with_Objects#Objects_and_properties). – Felix Kling Mar 04 '15 at 16:48

0 Answers0