Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bubble-sort-js

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bubble-sort-js - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

2

package.json
{
"name": "bubble-sort-js",
"version": "0.0.1",
"version": "0.0.2",
"description": "Bubble Sort algorithm javascript implementation. ",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -18,5 +18,3 @@ # Bubble Sort

// Ascending order
bubblesort([3,1,4,1,5,9,2,6,5,4]);

@@ -33,3 +31,2 @@ // => [1,1,2,3,4,4,5,5,6,9]

// Descending order
function comparator(a, b) { return b - a; }

@@ -45,2 +42,3 @@

// Ascending sort arrays of objects
function orderImages(a, b) { return a.order - b.order };

@@ -54,13 +52,11 @@ const images = [

function orderImages(a, b) { return a.order - b.order };
bubblesort(people, comparePeople);
bubblesort(images, orderImages);
/*
=> [
{href: 'http://path/to/something/terrifik', caption: 'Terrifik', order: 1},
{href: 'http://path/to/something/amazing', caption: 'Amazing', order: 2},
{href: 'http://path/to/something/crazy', caption: 'Crazy', order: 3},
{href: 'http://path/to/something/awesome', caption: 'Awesome', order: 4}
]
{href: 'http://path/to/something/terrifik', caption: 'Terrifik', order: 1},
{href: 'http://path/to/something/amazing', caption: 'Amazing', order: 2},
{href: 'http://path/to/something/crazy', caption: 'Crazy', order: 3},
{href: 'http://path/to/something/awesome', caption: 'Awesome', order: 4}
]
*/
```
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc