This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//1. FizzBuzz | |
function fizzBuzz(number) { | |
var buzz = number % 5 === 0, fizz = number % 3 === 0; | |
if (fizz && buzz) return "fizzbuzz"; | |
else if (buzz) return "buzz"; | |
else if (fizz) return "fizz"; | |
else return String(number); | |
}; | |
//2. onClickList |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Http_Response | |
attr_reader :version, :status_code, :reason_phrase, :content_type, :body | |
def intialize(args) | |
@version = args.fetch(:version) | |
@status_code = args.fetch(:status_code) | |
@reason_phrase = args.fetch(:reason_phrase) | |
@content_type = args.fetch(:content_type) | |
@body = args.fetch(:body) | |
end | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Queue | |
attr_reader :store | |
def initialize | |
@store = [] | |
end | |
def enqueue(x) | |
store.push(x) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Queue | |
attr_reader :store | |
def initialize | |
@store = [] | |
end | |
def enqueue(x) | |
store.push(x) | |
end |