I understand that function expressions must be expressed at the top if you want to use them vs function declarations which are hoisted to the top.
When I call my constructor from with window.onload, it works. However if I don't have a window.onload, and call my constructor before my function expression, the code breaks.
<script type="text/javascript">
window.onload = function () {
var c = new C();
} // this works, but if i delete window.onload the code breaks.
var C = function () {
console.log("test");
};
</script>