Skip to content

Instantly share code, notes, and snippets.

View techiediaries's full-sized avatar

Techiediaries (Now 10xdev.blog) techiediaries

View GitHub Profile
async function fibonacci(n){
if (n < 0) throw new Error('must be 0 or greater');
if (n === 0) return 0;
if (n === 1) return 1;
return await fibonacci(n - 1) + await fibonacci(n - 2);
}
function isPrime(num){
for (let i = 2; i < num; i++)
if (num % i === 0) return false;
async function fibonacci(n){
if (n < 0) throw new Error('must be 0 or greater');
if (n === 0) return 0;
if (n === 1) return 1;
return await fibonacci(n - 1) + await fibonacci(n - 2);
}
function isPrime(num){
for (let i = 2; i < num; i++)
if (num % i === 0) return false;
describe("MyJSUtilities", function() {
/* ... */
});
describe("String Utils", function() {
/*...*/
});
describe("Math Utils", function() {
/*...*/
});
describe("Basic Math Utils", function() {
/* ... */
});
describe("Advanced Math Utils", function() {
/* ... */
});
describe("String Utils", function() {
it("should be able to lower case a string",function() {
/*...*/
});
it("should be able to upper case a string",function() {
/*...*/
});
it("should be able to confirm if a string contains a substring",function() {
/*...*/
});
describe("Basic Math Utils", function() {
it("should be able to tell if a number is even",function() {
/*...*/
});
it("should be able to tell if a number is odd",function() {
/*...*/
});
});
describe("Basic Math Utils", function() {
it("should be able to tell if a number is even",function() {
/*...*/
});
it("should be able to tell if a number is odd",function() {
/*...*/
});
});
describe("Advanced Math Utils", function() {
it("should be able to tell if a number is prime",function() {
/*...*/
});
it("should be able to calculate the fibonacci of a number",function() {
/*...*/
});
});
describe("MyJSUtilities", function() {
describe(">String Utils", function() {
it("should be able to lower case a string",function() {
expect().nothing();
});
it("should be able to upper case a string",function() {
expect().nothing();
});
it("should be able to confirm if a string contains a substring",function() {