Skip to content

minhhnob/example-sum-td

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

example-sum-hminhthu

Welcome to example-sum-hminhthu, a simple JavaScript library that provides utility functions to work with objects, arrays, and perform basic arithmetic operations.

Installation


npm install example-sum-hminhthu

Usage

First, import the required functions from the library:


const { areObjects, areArrays, sum } = require('my-library');

Checking if Two Items are Objects

You can use the areObjects function to check if two items are objects:


const obj1 = { a: 1 };
const obj2 = { b: 2 };
console.log(areObjects(obj1, obj2));  // Output: true

Checking if Two Items are Arrays

You can use the areArrays function to check if two items are arrays:


const arr1 = [1, 2, 3];
const arr2 = [4, 5, 6];
console.log(areArrays(arr1, arr2));  // Output: true

Summing Three Numbers

The sum function allows you to sum three numbers:


const result = sum(1, 2, 3);
console.log(result);  // Output: 6

API

areObjects(obj1, obj2)

Checks if obj1 and obj2 are both objects.

  • obj1 (any): The first item to check.
  • obj2 (any): The second item to check.
  • Returns: true if both items are objects, otherwise false.

areArrays(arr1, arr2)

Checks if arr1 and arr2 are both arrays.

  • arr1 (any): The first item to check.
  • arr2 (any): The second item to check.
  • Returns: true if both items are arrays, otherwise false.

sum(a, b, c)

Sums three numbers a, b, and c.

  • a (number): The first number.
  • b (number): The second number.
  • c (number): The third number.
  • Returns: The sum of the three numbers.

License

This project is licensed under the MIT License.

About

A library helps you calculate the sum of any three numbers. Simple, user-friendly, extremely lightweight.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors