Skip to content

Commit f5eef2a

Browse files
committed
Arrow functions
1 parent e51ed19 commit f5eef2a

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

lib/game.js

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,12 @@ const ball = (x, y, level, id) => {
2828
const PendingBalls = (leftLevel, rightLevel) => {
2929
var rotation = 0
3030
var position = 5
31+
3132
const leftBall = ball(0, 0, leftLevel)
3233
const rightBall = ball(0, 0, rightLevel)
3334

34-
function isVertical () {
35-
return position === 1 || position === 3
36-
}
37-
38-
function maxLeft () {
39-
return isVertical() ? 0 : 1
40-
}
35+
const isVertical = () => position === 1 || position === 3
36+
const maxLeft = () => isVertical() ? 0 : 1
4137

4238
function moveLeft () {
4339
position = Math.max(maxLeft(), position - 1)

0 commit comments

Comments
 (0)