KScript 문서
KO

언어

영어에서 자동 번역되었습니다. 원문은 영어입니다.

Playground

The playground runs scripts on your computer, so it needs kscript docs. This copy of the docs was written by kscript docs --export-to to read offline.

Run kscript docs to open the docs with the playground, and with a Run button on every example.

<let name="name" value="'World'" />
<echo>Hello, $name!</echo>

<let name="people" value="[{ name: 'Joan', age: 82 }, { name: 'Sam', age: 35 }]" />
<for each="p" in="$people->sort(by: fn(p) => $p.age)">
  <echo>{ $p.name } is { $p.age }</echo>
</for>
$name = 'World'
echo "Hello, { $name }!"

$people = [{ name: 'Joan', age: 82 }, { name: 'Sam', age: 35 }]
for p in $people->sort(by: fn(p) => $p.age) {
  echo "{ $p.name } is { $p.age }"
}