Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: add runnable examples with test harness#628

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
itzshikharofficial12 wants to merge1 commit intoleonardomso:master
base:master
Choose a base branch
Loading
fromitzshikharofficial12:add-runnable-examples-and-tests

Conversation

@itzshikharofficial12

This PR adds runnable JavaScript examples with a test harness to help developers better understand the core concepts.

What's included:

  • Newexamples/ folder with concise, runnable code examples
  • Test harness supporting both sync and async tests
  • Individual test files for each example
  • Updated README and package.json with examples info
  • All tests passing (7/7)

Examples demonstrate:

  • Call stack behavior (LIFO order)
  • Primitives vs references (value vs reference types)
  • Closures (lexical scope)
  • Map/filter/reduce array operations
  • Event loop (macro vs microtasks)
  • This/call/bind behavior
  • Promises/async/await patterns

How to use:

Run a single example:

node examples/event-loop.js# or any other example

Run all tests:

npmtest

Each example is self-contained and includes expected output in comments.

- Added examples/ folder with concise, runnable code examples- Created test harness with sync/async support- Added test files for each example- Updated README and package.json with examples info- All tests passingExamples demonstrate:- Call stack behavior- Primitives vs references- Closures- Map/filter/reduce- Event loop- This/call/bind- Promises/async/await
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

@itzshikharofficial12

[8]ページ先頭

©2009-2025 Movatter.jp