Should YouTube api width, height values be in quotes or not?

What does the youtube javascript api say about whether or not ‘width’ and ‘height’ values should be in quotes or not?

I’m seeing it written both ways.

Here it shows one in quotes, then another that isn’t in quotes:

Which should it be?

Which would be the correct, or right syntax to use and why?

new YT.Player(video, {
      width: 606,
      height: 344,


new YT.Player(video, {
      width: "606",
      height: "344",

It says that it’s a number, so use a number.

Reference; https://developers.google.com/youtube/iframe_api_reference#Loading_a_Video_Player

This is a number:
width: 606,

What would this be called?
width: "606",

Does it have a different name?

Yes, that is text, called a String in JavaScript.

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.