Writing Functions

The + is used to concatenate or join together strings with code. For example, here 'url("'+ previewPic.src + '")';, you are connecting the string url(" to previewPic.src and then to ") . The strings are surrounded by ’ '.

In the end it will be interpreted as url(“previewPic.src”);

1 Like