As always, there is no need to use any language but Elixir. We'll establish a signature with a guard clause to make sure the user can only pass a natural number, and a private chirp_ signature to do the work of building the list of chirps, with a default empty list as its second argument. We could use List.duplicate, if the point of this exercise wasn't to make a recursive call 😜
As always, there is no need to use any language but Elixir. We'll establish a signature with a guard clause to make sure the user can only pass a natural number, and a private
chirp_
signature to do the work of building the list of chirps, with a default empty list as its second argument. We could useList.duplicate
, if the point of this exercise wasn't to make a recursive call 😜