Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

iterate object properties

Open
#606 2 comments 0 reactions 0 assignees View on GitHub

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from bigskysoftware/_hyperscript

All issues in bigskysoftware/_hyperscript

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.