Skip to content

Commit

Permalink
Change the array operations example to a better one
Browse files Browse the repository at this point in the history
  • Loading branch information
mustafaakin committed Feb 27, 2024
1 parent 2f626ad commit 346a9c6
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ func main() {

Since we use V8 engine underneath, many things are possible.


- **Simple Arithmetic**:
- Template: `The sum of 5 and 3 is {{ 5 + 3 }}.`
- Bindings: `{}`
Expand All @@ -109,9 +108,9 @@ Since we use V8 engine underneath, many things are possible.
- Output: `Good morning, Alice!`

- **Array Operations**:
- Template: `There are {{ fruits.length }} fruits in the basket.`
- Bindings: `{ "fruits": ["apple", "banana", "cherry"] }`
- Output: `There are 3 fruits in the basket.`
- Template: `Users list: {{ users.map(user => user.name).join(', ') }}`
- Bindings `{users: [{name: 'Alice'}, {name: 'Bob'}, {name: 'Charlie'}]}`
- Output: `Users list Alice, Bob, Charlie`

- **Object Manipulation**:
- Template: `{{ user.firstName }} {{ user.lastName }} is {{ user.age }} years old.`
Expand Down

0 comments on commit 346a9c6

Please sign in to comment.