Skip to content
This repository has been archived by the owner on Jul 24, 2021. It is now read-only.

Latest commit

 

History

History
52 lines (44 loc) · 1.1 KB

character-collections.md

File metadata and controls

52 lines (44 loc) · 1.1 KB

Character Collections

In these docs, you may see a type called Character. A Character is any value that when coerced to a string, has length of one.

Example Valid Characters:

  • 1
  • "1"
  • "a"
  • { toString() { return "a" } }
  • "ㅂ"

Example Invalid Characters:

  • true
  • 27
  • ㅂㅈㄷㄱ
  • {}
  • "foobar"
  • "[object Object]"

Even without the hardFail flag enabled, functions that expect Characters will error if the argument is not a Character.

Valid Character Groups are Arrays, Strings, or Numbers that are longer than 1.

Example Valid Character Groups:

  • 12
  • "12"
  • ㅂㅈㄷㄱ
  • "foobar"
  • "[object Object]"

Example Invalid Character Groups:

  • 1
  • "1"
  • "a"
  • { toString() { return "a" } }
  • "ㅂ"

Another type that functions from this library take is what's called a CharacterCollection. Character Collections are Character Groups or Characters. All Strings are valid Character Collections.

Example Valid Character Collections

  • ""
  • 1
  • "1"
  • "a"
  • { toString() { return "a" } }
  • "ㅂ"
  • 12
  • "12"
  • ㅂㅈㄷㄱ
  • "foobar"
  • "[object Object]"