I dynamically added
var script = document.createElement(`script`);
script.src = `https://checkout.stripe.com/checkout.js`;
Because it takes time to load and execute the script. When you log
window, by the time you expand the object, the script has loaded and executed. Same for when you run
window.StripeCheckout in the developer console.
When you hover over that little
[i] in the console it will also tell you that the "content" of the object was just evaluated when you expanded that line.
console.log(window.StripeCheckout) is executed before the script is evaluated. So the property cannot exist at that moment, even if the script was available immediately.
If you want to know when the script loaded have a look at