Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Javascript Basics
const maxHealth = 100; var currentHealth = 50; var numberLives = 5; currentHealth = maxHealth; var characterName = "Wishmaster"; var currentLevel = 1; //var isGameOver = false; //print(isGameOver); // const (value that can't be changed, let (scope base), var //if (true) { //var isGameOver = false; //var and const can be access inside and outside of code blocks //let isGameOver = false; //} let message = "Hi, my name is " + characterName; //"Hi, my name is ${characterName}"; <-- Interpolation let length = characterName.length; let upperName = characterName.toUpperCase(); let lowerName = characterName.toLowerCase(); let wish = characterName.slice(0,4); let level = "Hello, your current on level " + currentLevel; print(message) print(wish) print(level)
run
|
edit
|
history
|
help
0
array objects to a single object
More testing with JS
Functions
Rocket Science
prime consecutive numbers
sortStack
Alternating Sign Fibonacci
ComposeWordsGrid
MyProfile_Medalla.java
Iterator()-function