Starting function won't run


#1

https://www.codecademy.com/en/courses/javascript-beginner-en-XEDZA/0/7?curriculum_id=506324b3a7dffd00020bf661

This is only a fraction of the code, but I can't get the first function to run. It just ends the lesson after the confirm.

Here is the start of my code:

confirm ("This is a simple text based adventure. Type north, east, south, and west to move. Type capital I to see what your carrying. Everything else should be typed in lowercase. Hit enter to start.")

    
                //Cabin

function cabin() {
var location = 1751;
console.log("Cabin")
do {
var location = prompt("You are standing west of the remains of a wooden cabin in an open jungle. The wind is blowing so hard that the trees are almost side ways. There is a wooden door leading into a cave to the north, to the east is a river that looks like it may be traversable, and a barbed wire fence blocks passage to the south.")
switch(location) {

    case 'I':
        console.log("You are carrying a compass.");
        location = 1751;
    break;

    case 'west':
        console.log("You can't climb over the cabins debris");
        location = 1751;
    break;

    case 'south':
        console.log("You can't climb over the fence it's covered in barbed wire.");
        location = 1751;
    break;

    case 'east':
        //canyon

        location = 2151;
    break;

    case 'north':
        location = 1846;
    break;

    default:
        console.log("That isn't a legitimate response.");
        location = 1751;
}//switch

}//do
while (location == 1751);
}//function

if(location === 1751) {
	cabin();
}
if(location === 2151) {
	canyon();
}
if(location === 1846) {
    cave();
}

Running the function from the prompt
Running the function from the prompt
#3

Hi kust need to call the function cabin...

cabin()

#10

Guys, can we have a bit of respect on this forum please, if anyone keeps spamming I will have to suspend or ban them.