diff --git a/index.js b/index.js index e69de29bb2..4a0d53e2b0 100644 --- a/index.js +++ b/index.js @@ -0,0 +1,26 @@ +var katzDeliLine = []; + +function takeANumber(katzDeliLine, name) { + katzDeliLine.push(name); + return "Welcome," + (name) + "You are number" + (katzDeliLine) + "in line."; +} + +function nowServing(katzDeliLine) { + if (katzDeliLine.length === 0) { + return "There is nobody waiting to be served!"; + } + if (katzDeliLine > 0) { + return "Now serving" + katzDeliLine.push(name); + } + else + "Currently serving" + katzDeliLine.push(name); "."; +} + +function currentLine(katzDeliLine) { + if (katzDeliLine.length === 0) { + return "The line is currently empty."; + } + for (var i = 0; i < katzDeliLine.length; i++) + katzDeliLine.push(i + 1 + ". " +katzDeliLine); + return "The line is currently:" + push(name); + } \ No newline at end of file