Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
gnat authored Sep 26, 2023
1 parent f3f4502 commit c1e70b0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ For devs who love ergonomics! You may appreciate Surreal if:
* Get 1 element: `me()`
* ..or many elements: `any()`
* `me()` or `any()` can chain with any Surreal function.
* `me()` can be used directly as a single element (like `querySelector()` or `$()`)
* `me()` can be used directly as a single element (like `querySelector()`)
* `any()` can use: `for` / `forEach` / `filter` / `map` (like `querySelectorAll()` or `$()`)
* 🌗 No forced style. Use: `class_add` or `classAdd` or `add_class` or `addClass`
* Use `camelCase` (Javascript) or `snake_case` (Python, Rust, PHP, Ruby, SQL, *CSS*).

### 🤔 Why use `me()` / `any()` instead of `$()`
* 💡 We solve the classic jQuery code bloat problem: Am I getting 1 element or an array of elements?
* `me()` is guaranteed to return 1 element (or first found, or none).
* `me()` is guaranteed to return 1 element (or first found, or null).
* `any()` is guaranteed to return an array (or empty array).
* No more checks! Write less code! Bonus: Code reads more like self-documenting english.

Expand Down

0 comments on commit c1e70b0

Please sign in to comment.