npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@ddnb/javascript

v1.2.0

Published

Javascript Challenges

Downloads

5

Readme

JavaScript Challenges

Overview

Welcome to the JavaScript Challenges Package! This package is designed to help beginners and intermediate developers learn JavaScript through practical coding exercises and programming challenges. Whether you are just starting or looking to sharpen your skills, this package provides a variety of functions and challenges to enhance your understanding of JavaScript.

Features

  • Learn JavaScript Basics: Explore fundamental concepts with easy-to-understand functions.
  • Programming Challenges: Solve challenges that reinforce your learning and improve problem-solving skills.
  • Well-structured Code: Clear examples and implementations to guide you through the learning process.
  • Testing with Jest: Built-in tests to validate your solutions and ensure code quality.

Installation

You can install the package via npm:

npm install @ddnb/javascript

Usage

To use the functions provided in this package, simply require it in your JavaScript file:

  • Import and Use the Classes in a Consumer Project
// Import specific classes
import { HelloWorld, DoorPassword } from '@ddnb/javascript';

// Or import the entire module
import * as Challenges from '@ddnb/javascript';

const helloWorld = new Challenges.HelloWorld();
helloWorld.greet(); // Output: "Hello, World!"
  • If your project uses CommonJS, modify index.js to use module.exports:
// index.js (CommonJS)
const HelloWorld = require('./classes/challenges/HelloWorld.js');

module.exports = { HelloWorld };

Programming Challenges

The package includes a series of programming challenges to help you practice your skills. Each challenge is designed to address different JavaScript concepts.

Example Challenge

Challenge: Write a function that takes an array of numbers and returns the sum.

Solution:

function sumArray(arr) {
    return arr.reduce((acc, num) => acc + num, 0);
}

Running Tests

To ensure everything is working correctly, you can run the tests included with the package. Make sure you have Jest installed, then run:

npm test
npx jest __tests__/HelloWorld.test.js

Contributing

Contributions are welcome! If you have ideas for new features, challenges, or improvements, please submit a pull request or open an issue.

License

This project is licensed under the MIT License. See the LICENSE file for more information.

Contact

If you have any questions or feedback, feel free to reach out!