I hereby claim:
- I am charlottebrf on github.
- I am charlotte_brf (https://keybase.io/charlotte_brf) on keybase.
- I have a public key whose fingerprint is 710D 271D BE1F D3C6 42F9 7CF2 315F 9592 B56A F822
To claim this, I am signing this object:
Simply put, destructuring in Clojure is a way extract values from a datastructure and bind them to symbols, without having to explicitly traverse the datstructure. It allows for elegant and concise Clojure code.
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
Full project can be found here: https://github.com/charlottebrf/third-js-string-calculator | |
Tests: | |
it("raises an error for a negative number", () => { | |
expect.throws(calculator.add("-1;2"), Error, "Error: negatives not allowed: -1") | |
}) | |
it("raises an for multiple negative numbers", () => { | |
expect.throws(calculator.add("3, -1, -2, 4"), Error, "Error: negatives not allowed: -1, -2") | |
}) |
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
Full project can be found here: https://github.com/charlottebrf/third-js-string-calculator | |
Tests: | |
it("raises an error for a negative number", () => { | |
expect.throws(calculator.add("-1;2"), Error, "Error: negatives not allowed: -1") | |
}) | |
it("raises an for multiple negative numbers", () => { | |
expect.throws(calculator.add("3, -1, -2, 4"), Error, "Error: negatives not allowed: -1, -2") | |
}) |
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 Account class: am I using state/ class injection in a better way here than V1?******** | |
class Account | |
attr_reader :balance, :statement | |
def initialize | |
@balance = 0 | |
@statement = Statement.new | |
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
**************PICTURES CONTROLLER:************** | |
class PicturesController < ApplicationController | |
before_action :require_login | |
def index | |
@pictures = Picture.all | |
end |