repl.it
@Craigsux/

javascript

Nodejs

No description

fork
loading
Files
  • index.js
  • info
  • input and output.js
  • Packager files
  • package-lock.json
  • package.json
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
function wrdBlanks(mynoun, myverb, myadjective, myadverb) {

  var result = "";
  result += "The " + myadjective + "" + mynoun + "" + myverb + "to the store " + myadverb
  return result;
}

console.log(wrdBlanks("dog ", "ran ", "fast ", "quickly"));
console.log(wrdBlanks("dog ", "ran ", "fast ", "quickly"));

///////////////////////////////////////////////////////

var a = 1;
a += 1;  // += is equivalent to + 1
var b = 2;
console.log(a + b) 

var c = 21;
var d = 56;
console.log(c * d)

///////////////////////////////////////////////////////

// add this in at the top of your program
var { question } = require('readline-sync');

// use `question()` instead of `prompt()` to get input
var userName = question('May I have your name? ');
console.log('Hi ' + userName + '!');

///////////////////////////////////////////////////////

function answer(exans)  {
  var exans1 = "";
  switch(exans)  {
    case 1:
    case 2:
    case 3:
      exans1 = "low";
      break;
    case 4:
    case 5:
    case 6:
      exans1 = "medium";
      break;
    case 7:
    case 8:
    case 9:
      exans1 = "high"
      break;
    default:
      exans1 = "other";

  }
  return exans1;
}



////////// continuing on //////////////////////////////

var house = room1;
var room1 = kitchen;
var kitchen = room2;
var room2 = bathroom;
var bathroom = room3;
var room3 = 2;
console.log(house)

///////////////////////////////////////////////////////

var i;
for (i = 0; i < cookie; i++)  {
  
}