Created
March 23, 2021 23:48
-
-
Save codergautam/5353df25c51e21e2d675c389cc755cbc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Y value is quadratic checker | |
//Checks if given y values are quadratic | |
//Y values | |
var numbers = [] | |
var arr2 = [] | |
var arr3 = [] | |
numbers.forEach((number, i) => { | |
if(i > 0) { | |
arr2[arr2.length] = number - (numbers[i-1]) | |
} | |
}) | |
arr2.forEach((number, i) => { | |
if(i > 0) { | |
arr3[arr3.length] = number - (arr2[i-1]) | |
} | |
}) | |
//if all values are equal, it is quadratic | |
console.log(arr3) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment