It's been a strange discovery I made while working with JavaScript. Whenever I try to assign a two-word string to a CSS property, like setting the fontFamily property of an HTML element to "Arial Black"
, it ends up looking something like this:
"\"Arial Black\""
. This behavior seems really odd and I can't figure out why it happens.
This is the code snippet that showcases this behavior:
element.style.fontFamily = "Arial Black"
>> "Arial Black"
element.style.fontFamily
>> "\"Arial Black\""
Does anyone have any insights or explanations for this unexpected behavior?
Thank you for your time.