How to switch scenes

can someone give me an example on a switch scene example.
keyboard input function{
switch scene function

I think these tutorials are very helpful:

thank you but its easier for me to understand with a more direct example.

Maybe this would work

if ({
  //Replace newSceneName with your scene name plz
  var oldScene = ("Root");
  var newScene ="newSceneName").url

  oldScene.destroy() newScene )


okie thx