bigskysoftware / bigskysoftware/_hyperscript

iterate object properties

Open
#606 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
3.8k
Forks
172
PR merge metrics
No merged PRs in 30d

Description

I tried something that was not documented: "Iterate over an object"
code:
```

init
set $o to { name: "john", age: 30 }
for value in $o index key
log key
log value
end
end

```

But I could not get it working. Trying multiple methods, most of them resulted into an error.
console:
```
Uncaught TypeError: i.iterator is undefined
op https://unpkg.com/hyperscript.org:1
unifiedEval https://unpkg.com/hyperscript.org:1
unifiedExec https://unpkg.com/hyperscript.org:1
execute https://unpkg.com/hyperscript.org:1
o https://unpkg.com/hyperscript.org:1
setTimeout handler*install https://unpkg.com/hyperscript.org:1
apply https://unpkg.com/hyperscript.org:1
initElement https://unpkg.com/hyperscript.org:1
processNode https://unpkg.com/hyperscript.org:1
forEach https://unpkg.com/hyperscript.org:1
processNode https://unpkg.com/hyperscript.org:1
w https://unpkg.com/hyperscript.org:1
n https://unpkg.com/hyperscript.org:1
w https://unpkg.com/hyperscript.org:1
promise callback*w https://unpkg.com/hyperscript.org:1
https://unpkg.com/hyperscript.org:1
https://unpkg.com/hyperscript.org:1
```
Since this works in normal javascript I think there must be a way to do this in hyperscript.
Please let me know how to do this.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.