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

cmpt315a2mikelee

v1.0.0

Published

functions for assignment 2 of cmpt 315

Downloads

2

Readme

cmpt315a2mikelee

Functions for cmpt 315 assignment 2

Purpose

**BEWARE: This library was published for learning purposes. It is not int Describe the intended intent

Usage

Install it: npm install leem252-cmpt315a2mikelee Require it: const _ = require('leem252-cmpt315a2mikelee'); Call it: const results = _.findNaNIndex(Number[]) const results = _.biggestLoser(Object[]) const results = _.countNumberOfArrays(Array) const results = _.isArrayFactorChain(Number[]) const results = _.participants(Object[]) const results = _.winnersObject(Object[]) ''

Documentation

The following functions are currently implemented: findNaNIndex(Number[]): This function loops through an array of numbers and NaN and pushes the index of each NaN found into a array called nanArray biggestLoser(Object[]): This function calculates the player with the most loser_points by taking in an array of match objects as a parameter. This function calculates the total amount of loser_points for each player by subtracting the loser_points of the match object from the winning player and adds the loser_points of the match object to the losing player. The function then finds the player with the most loser_points by using the reduce method and returns the name of the player with the most loser points countNumberOfArrays(Array): This function takes an array and counts the number of arrays that are within it using an arrayCounter variable that is incremented by 1 everytime it finds an array inside the given array isArrayFactorChain(Number[]): This function takes data(an array of numbers) and iterates through the array, the function uses the modulo operator to check if an array of numbers will form a factor chain by seeing if each number will evenly divide the next number participants(Object[]): This function creates an array of player names and loops through the matches array it pushes all names from the winner and loser of each match, if they have not been added to the namesArray already, so that there are no duplicate names winnersObject(Object[]): This function creates an array of all players using the participants function and then creates a new winningPlayers object where the key is the player name, value is an empty array it then loops through each match and pushes the loser name to the winningPlayer in the winningPlayers array