iterate object properties
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 38/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- javascript
- Domain
- web-dev
Research direction
Start by reproducing the HTML hyperscript snippet from the issue with the object containing name and age, then inspect how the existing for-loop handles its input. Confirm how object properties should expose key and value, and consider the work complete when the example iterates without the reported TypeError and logs both properties.
Written by the indexing model from the issue text.
Description
I tried something that was not documented: "Iterate over an object"
code:
<script type="text/hyperscript">
init
set $o to { name: "john", age: 30 }
for value in $o index key
log key
log value
end
end
</script>
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
<anonymous> https://unpkg.com/hyperscript.org:1
<anonymous> 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.
- Dominant language
- JavaScript
- Stars
- 3.8k
- Forks
- 171
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from bigskysoftware/_hyperscript
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
bigskysoftware/_hyperscript#688 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
bigskysoftware/_hyperscript#678 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
bigskysoftware/_hyperscript#676 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
bigskysoftware/_hyperscript#695 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 62/100
bigskysoftware/_hyperscript#687 ·
All issues in bigskysoftware/_hyperscript
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
antfu-collective/icones#398 ·
-
ECmail.com Open
Difficulty 1/5 Under an hour Newbie friendliness 90/100
wesbos/burner-email-providers#554 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
radiantearth/stac-browser#1023 ·
-
HMR stops working Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
components-web-app/docs#92 ·