VelocityY undefined

I used an example from phaser.io (click here) and tried to edit it to make my own game, but once I tried adding a jump/fall animation I ran into a problem (my code here)

Code snpipet
if (cursors.up.isDown && player.body.touching.down) {
  player.setVelocityY(-330);
  if (player.VelocityY < 0) {
    cosnole.log('jumping');
    player.anims.play('jump', true);
  }

  if (player.VelocityY >= 0) {
    console.log('falling');
    player.anims.play('fall', true);
  } else {
    console.log('FAILED');
    console.log(player.VelocityY);
  }
}

Gave me the output “FAILED” and then “undefined”, but my player still jumps.
How is it possible that the code uses a not existing value without running into an error?

Btw. why is my code showen two times?

When I used like in my old code: player.body.setVelocityY, it workes half,
I mean, it prints the velocity but the animations still doesn’t play

maybe its because you put an extra true after player.anims.play(‘jumping’) and player .anims.play(‘fall’) or you wrote cosnole.log(“jumping”) instead of console.log("jumping).

try removing the true after ‘fall’ and ‘jumping’

Use player.body.velocity.y.

Also, the logic looks a little wrong. Try

if (player.body.touching.down) {
  // On floor.
  if (cursors.up.isDown) {
    player.setVelocityY(-330);
    player.anims.play('jump');
  }
} else {
  // In the air.
  if (player.body.velocity.y >= 0) {
    player.anims.play('fall', true);
  }
}