on-internet
← Community

If you put a fat arrow or function inside an alert, prompt, or confirm, will it return it as a string?

Stack Overflow ·

I was trying to create a breakout game using JavaScript's confirm function. When I opened the file on my laptop, I got the fat arrow function I used as a string in the confirm window. Here is the code I used in the confirm function: const move = confirm( // Renders The Game On The Confirm () => { const grid = Array.from( {length: HEIGHT}, () => Array(WIDTH).fill(EMPTY) ); for (let row = 0; row < BRICK_ROWS; row++) { for (let col = 0; col < WIDTH; col++) { if (bricks[row][col].alive) grid[row][col] = bricks[row][col].color; } } grid[ballY][ballX] = BALL; for (let i = 0; i < PADDLE_WIDTH; i++) {

Comments

Sign in or sign up to comment and upvote.

No comments yet.