spirodonfl / cursed-programming-1

We house everyone's cursed programming projects here
MIT License
9 stars 4 forks source link

Cursed Javascript debugging challenge #5

Open ILOVEPIE opened 8 months ago

ILOVEPIE commented 8 months ago

Scenario:

Someone comes you with some code complaining it's misbehaving. Help them determine why.

Note: Make sure you run the code exactly as written. Note: Using ChatGPT or another AI is cheating.

The Code:

let x = 0;
х = x + 5;
console.log(x);
х = x + 5;
console.log(х);
console.log(x/5);

Expected Output:

5
10
2
ILOVEPIE commented 8 months ago

Scenario:

Someone else comes to you saying that console.log is broken in node.js and gives you some code as proof:

Note: Make sure you run the code exactly as written. Note: Using ChatGPT or another AI is cheating.

The Code:

let В = console.log;
B("test");

Expected Output:

test