# Kleine Helper: GUID, HASH, parseConfig, format und group

> Nutze die Hilfsfunktionen, die jComponent hinzufügt: zufällige IDs, Hashes, Konfigurationsstrings, Text- und Datumsformatierung und Gruppierung.

Framework: jcomponent20
Product: jComponent 20 (jcomponent@20)
Language: de
Content-SHA256: 4cf577bdc5340aefed59a6e19616d5a2c50eef0780bcdf7f0032d6741577123b
Snapshot: c0700e321579725c5cf4f5ace1ad7d2866d1b4f93c24a63c0b41b6b7998e976c
Sources: jcomponent20@3fedd009a277f50fddc608b97afbec553b67c51b
Review: not-recorded

jComponent fügt einige Helper hinzu, die dir das Laden einer Utility-Bibliothek ersparen:

- `GUID(length)` liefert eine zufällige ID; `HASH(value)` liefert einen numerischen Hash eines beliebigen Werts
- `'key:value;key2:value2'.parseConfig()` parst einen Konfigurationsstring in ein Objekt und wandelt Zahlen und Booleans um
- `'{0} is {1}'.format('a', 'b')` ersetzt `{index}`-Platzhalter
- `number.format(decimals, thousandsSeparator, decimalSeparator)` und `date.format('yyyy-MM-dd')` formatieren Zahlen und Datumswerte
- `array.group('field')` gruppiert Objekte nach einem Feld in `[{ name, items }]`
- `PARSE(json)` parst JSON und wandelt Datums-Strings in `Date`-Objekte um; `date.add('1 day')` verschiebt ein Datum

```html public/index.html
<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8" />
	<title>jComponent</title>
	<link rel="stylesheet" href="//cdn.componentator.com/spa.min@20.css" />
	<script src="//cdn.componentator.com/spa.min@20.js"></script>
</head>
<body>
	<p class="out"></p>

	<script>

		window.sample = {
			guid: GUID(12),
			samehash: HASH('total') === HASH('total'),
			config: 'size:3;active:true;name:Peter'.parseConfig(),
			text: '{0} is {1}'.format('Total.js', 'great'),
			price: (1234.5).format(2),
			date: new Date(2026, 9, 16).format('yyyy-MM-dd'),
			groups: [{ type: 'a', n: 1 }, { type: 'b', n: 2 }, { type: 'a', n: 3 }].group('type'),
			parsed: PARSE('{"created":"2026-10-16T10:00:00.000Z"}').created instanceof Date,
			tomorrow: new Date(2026, 9, 16).add('1 day').getDate()
		};

	</script>

</body>
</html>
```
