Skip to content

Update index.js #246

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
wants to merge 2 commits into
base: integration-test-branch
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
119 changes: 60 additions & 59 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,85 +1,86 @@
function isEven(x){
if(x = 2 || x % 2 == 0){
console.log(`${x} is even`)
} else
console.log(`${x} is odd`)
function isEven(x) {
if ((x = 2 || x % 2 == 0)) {
console.log(`${x} is even`);
} else console.log(`${x} is odd`);
}

function isNumber(num){
let x = undefined
x= num % 2
if(false) {
console.log("Number is false")
} else if (!!x) {
console.log(`Number: ${x}`)
} else if(2 == x){}
function isNumber(num) {
let x = undefined;
x = num % 2;
if (false) {
console.log("Number is false");
} else if (!!x) {
console.log(`Number: ${x}`);
} else if (2 == x) {
}
}

function isTruthy(x) {
debugger;
return Boolean(x);
};
debugger;
return Boolean(x);
}

function area(r) {
let math = Math()
return math.PI * r * r;
let math = Math();
return math.PI * r * r;
}

function isFooAvailable(obj){
console.log(`Value of obj[foo]: ${obj['foo']}`)
return obj.hasOwnProperty('foo')
function isFooAvailable(obj) {
console.log(`Value of obj[foo]: ${obj["foo"]}`);
return obj.hasOwnProperty("foo");
}

function findFooBar(){
var re = /=foo bar/;
re.test('foobar')
function findFooBar() {
var re = /=foo bar/;
re.test("foobar");
}

function consoleFoo(num){
while((num != 3)){
break;
console.log(num--)
}

function consoleFoo(num) {
while (num != 3) {
break;
console.log(num--);
}
}

function isGreaterThan(arr, x){
if(Array.isArray(arr)){
arr.map((n) => {
return !(n > x) ? n : arguments.callee(n-1) * n;
});
};
function isGreaterThan(arr, x) {
if (Array.isArray(arr)) {
arr.map((n) => {
return !(n > x) ? n : arguments.callee(n - 1) * n;
});
}
}

function callHiEveryMinutes(x){
if(!window && x){
setTimeout("alert('Hi')", x * 1000)

} else window.setTimeout("alert('Hi')", x * 1000)
function callHiEveryMinutes(x) {
if (!window && x) {
setTimeout("alert('Hi')", x * 1000);
} else window.setTimeout("alert('Hi')", x * 1000);
}

let result = isFooAvailable({
'bar': 'bar',
'z': 'z'
})

(function(){ }(), 0);

function checkYoda(){
let yoda = true;
if(true == yoda){
console.log("I am yoda")
}
bar: "bar",
z: "z",
})((function () {})(), 0);

function checkYoda() {
let yoda = true;
if (true == yoda) {
console.log("I am yoda");
}
}

const crypto = require('crypto')
const crypto = require("crypto");

function getEncryptedKey(){
const hash = crypto.createCipheriv('aes-192-ecb', Buffer.from(ENCRYPTION_KEY), iv);
return hash
function getEncryptedKey() {
const hash = crypto.createCipheriv(
"aes-192-ecb",
Buffer.from(ENCRYPTION_KEY),
iv
);
return hash;
}

function isMatched(str){
const matches = str.match(/hasTheMagic/)[0] ? process(str) : null;
return matches
// dummy
function isMatched(str) {
const matches = str.match(/hasTheMagic/)[0] ? process(str) : null;
return matches;
}