Skip to content

Commit

Permalink
Added some JSString documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
fadrian06 committed Jan 7, 2024
1 parent 66a427c commit fab9930
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
15 changes: 15 additions & 0 deletions LEAME.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,21 @@ echo $nombre->toUpperCase(); # Salida: FOO
$usuario = JSON::parse('{ "id": 1, "nombre": "foo" }');
echo $usuario->nombre; # Salida: foo

$colores = JSArray(['rojo', 'púrpura', 'negro']);
$colores->forEach(function (?string $color): void {
echo "Me gusta el color $color\n";
});

echo "\ncolores = $colores";

/* Output:
----------
Me gusta el color rojo
Me gusta el color púrpura
Me gusta el color negro

colores = rojo,púrpura,negro
*/
```

## Componentes
Expand Down
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,21 @@ echo $name->toUpperCase(); # Output: FOO
$user = JSON::parse('{ "id": 1, "name": "foo" }');
echo $user->name; # Output: foo

$colors = JSArray(['red', 'purple', 'black']);
$colors->forEach(function (?string $color): void {
echo "I like the color $color\n";
});

echo "\ncolors = $colors";

/* Output:
----------
I like the color red
I like the color purple
I like the color black

colors = red,purple,black
*/
```

## Components
Expand Down

0 comments on commit fab9930

Please sign in to comment.