Skip to content

Me5uT/SolutionJs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SolutionJS

This package is that contains a small part of the solutions to the cases solved by a junior frontend developer in order to develop it himself. I will add more solutions as soon as possibly.

Installation

npm i solutionjs

Usage

import { sumOfTwoNumbers } from 'solutionjs';

const twoPlusFour = sumOfTwoNumbers(2, 4);
console.log('Result = ', twoPlusFour); // Result = 6

Methods

Method Name Description Return Type Parameters
areaOfCircle 'Returns area of circle' number radius : number
areaOfSquare 'Returns area of square' number side : number
binToDecimal 'Returns decimal value of given bin value' number bin : string
capitalizeFirstCharacter 'Returns words, first letters capitalized' string word : string
celciusToFahreneit 'Returns fahreneit value' number celcius : number
consecutiveNumbersInRange 'Returns an array with consecutive numbers in given range' number[] min : number, max : number
divisibleBy 'Returns an array with divisible numbers by given number' number[] numbers: number[], divisor: number
fahreneitToCelcius 'Return celcius value of given fahreneit value' number fahreneit: number
findDifferences 'Returns an array with [ inJustFirstArray, sameElements, inJustSecondArray ]' [any[], any[], any[]] firstArray: any[], secondArray: any[]
findLostNumbers 'Returns an array with lost numbers by given numbers' number[] numbers: number[]
findMax 'Returns maximum numbers in given array' number numbers: number[]
findMin 'Returns minimum numbers in given array' number numbers: number[]
findUnique 'Returns an array with unique elements of given array' any[] elements: any[]
firstNonConsecutive 'Returns first non consecutive number or null' null | number numbers: number[]
getFactorial 'Returns factorial value of given number' number num: number
groupByFirstLetter 'Returns an object grouped by first letter' object strings: string[]
hexToDecimal 'Returns decimal value by converted hex string' number hexString: string
isBetterThanAverage 'Returns true if your point greater than average of otherPoints, otherwise false' boolean otherPoints: number[], yourPoint: number
multiplyOfNumbers 'Returns multiply of given numbers' number numbers: number[]
multiplyTwoNumbers 'Returns multiply of two numbers' number firstNumber: number, secondNumber: number
oppositeOfNumber 'Returns opposite of given number' number num: number
percentageOfNumber 'Return the given percentage of the number' number num: number, percent: number
perimeterOfRectangle 'Returns perimeter of rectangle' number length: number, width: number
reverseString 'Returns a string, reserved of given string' string str: string
setAndSort 'Returns an array of set and sorted given arrays' number[] arrayOne: number[], arrayTwo: number[]
bubbleSort 'Returns a sorted array with Bubble Sort Method' number[] numbers: number[]
heapSort 'Returns a sorted array with Heap Sort Method' number[] numbers: number[]
insertionSort 'Returns a sorted array with Insertion Sort Method' number[] numbers: number[]
quickSort 'Returns a sorted array with Quick Sort Method' number[] numbers: number[]
selectionSort 'Returns a sorted array with Selection Sort Method' number[] numbers: number[]
shellSort 'Returns a sorted array with Shell Sort Method' number[] numbers: number[]
squareOfNumber 'Returns square of given number' number num: number
sumOfNumbers 'Returns sum of numbers in array' number numbers: number[]
sumOfTwoNumbers 'Returns sum of given two numbers' number firstNumber: number, secondNumber: number
swapObjKeyAndValue 'Swap the Javascript object's key with its values and return the resulting object' any obj: any
symmetricPoint 'Returns the symmetry of the first point to the second point' [number, number] p: [number, number], q: [number, number]