General Question about Javascript and PHP

General Question about Javascript and PHP


When i normally code a site/app i always store variables in a php file called config and include it in the index and whenever i need the variable i just echo it! Like so

$sitename = "SiteName";


<title><?php echo $sitename; ?></title>

Is there a similar way of doing this with javascript/jquery ? 

I know this question might be a little strange but i am curious if any have an easier way or storing site variable and calling them whenever necessary instead of using php?