Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // TODO: Help command
- function help(str){
- if (str == sq) {
- console.log("function sq squares your number, and only take one argument of type interger");
- } else if (str == cube) {
- console.log("function cube cubes your number, and only take one argument of type interger");
- } else if (str == repeatMe) {
- console.log("function repeatMe repeats what you say in an alert, and only take one argument of type string");
- } else {
- console.log("thanks for typing in help, currently this website only has 3 console programs:");
- console.log("--> sq()");
- console.log("--> cube()");
- console.log("--> repeatMe()");
- console.log("To know more info, type help and in the brackets put the program name without the brackets");
- console.log("e.g.");
- console.log("help(repeatMe)");
- }
- }
- // Square numbers
- // Take only one argument of type integer
- function sq(x){
- return x * x;
- }
- // Cube numbers
- // Takes only one argument of type integer
- function cube(x){
- return x * x * x;
- }
- // Repeat yourself
- // Take only one argument of type string
- function repeatMe(str){
- alert(str);
- }
- function devNote(userName,password){
- if (userName == "dev" && password == "devaccess") {
- console.log("welcome to dev access");
- console.log("this place is to show that only people who are developers can access this place");
- console.log("src code avail at ");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement