I'd suggest trying to avoid using while(true) and break -- it reeks of spaghetti code jump-style.
You could just do-while there. As someone weaned on assembly and pascal, the do/while (what Pascal calls repeat/until, and in ASM is the cornerstone of all efficient loops) structure is just closer to how the hardware works and feels more intuitive the lower-level you go. As a construct, while (true) is just a wasted boolean comparison in the loop.
do {
myConsole.print('Take a guess: ');
guess = parseInt(await myConsole.readln());
myConsole.println(guess.toString());
myConsole.println(
guess > number ? 'My number is smaller!' : (
guess < number ?
'My number is greater!' :
`Congratulations, ${playerName}! My random number is ${number}!`
)
);
} while (guess !== number);
Also, ternary operators are your friend. If every single result is just going to println, you only need one println.