This file contains hidden or 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
var db = {}; | |
//Create | |
db["queijo"] = "batata"; | |
//Read | |
console.log(db.queijo); | |
//Update | |
db["queijo"] = "batata_1"; |
This file contains hidden or 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
function shift(value) { | |
const internal = { | |
option: (target, callback) => { | |
switch(typeof target) { | |
case "object": | |
target.includes(value) && callback(target[target.indexOf(value)]) | |
break; | |
default: | |
value === target && callback(target) |
This file contains hidden or 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
let res = []; | |
let base = [1, 2, 3, 4]; | |
let groupQuantity = 2; | |
for(let i = 0; i < base.length; i += groupQuantity) { | |
let even = []; | |
for(let gq = 0; gq < groupQuantity; gq++) { | |
base[i + gq] ? even.push(base[i + gq]) : {}; | |
} | |
res.push(even); |
NewerOlder