JS to run conditionally based on browser tab title

Viewed 10

complete coding & JS noob here, so I appreciate this may seem like a very stupid question:

I have some very basic JS (below) that I would like to run based on the of the browser tab that it is running in. How do I make this run if the browser title is "xyz"?

var x = "thing";
console.log(x);
0 Answers
Related