Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

elixir guards

defmodule Guard do
  def kind_of(x) when is_binary(x) do
    "#{x} is a binary"
  end

  def kind_of(x) when is_atom(x) do
    "#{x} is an atom"
  end

  def is_ten(x) when x > 10, do: "Greater than ten"

  def is_ten(x) when x < 10, do: "Less than ten"

  def is_ten(x), do: "Yes"
end
Comment

PREVIOUS NEXT
Code Example
Javascript :: make input bigger if text does not fit 
Javascript :: Object Property Shorthand javascript 
Javascript :: react table className 
Javascript :: how to add react.memo in export list 
Javascript :: length array 
Javascript :: angular singleton service example 
Javascript :: json parse 
Javascript :: angular 7 selected 
Javascript :: jquery check if all elements hidden 
Javascript :: React S3 Bucket 
Javascript :: how to strip html tags in javascript 
Javascript :: setstate 
Javascript :: reduce method in javascript 
Javascript :: socket io new server multiple origins 
Javascript :: javascript conditional ? : 
Javascript :: js detect mouse support 
Javascript :: js example 
Javascript :: how to create an html element in javascript without document 
Javascript :: bubbling and capturing in javascript 
Javascript :: How to add click event to table row js 
Javascript :: convert javascript to ruby 
Javascript :: angular material button color 
Javascript :: grouped bar charts in chart js 
Javascript :: multi filtering react 
Javascript :: check if field exists in object javascript 
Javascript :: pass props in react 
Javascript :: react native share link 
Javascript :: js get folder of current script 
Javascript :: is loop backward 
Javascript :: datepicker date and time 
ADD CONTENT
Topic
Content
Source link
Name
5+8 =