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
function isZigzag(numbers) { | |
let arr = [] | |
for(let i = 0; i < numbers.length - 2; i++) { | |
if ((numbers[i] < numbers[i+1] && numbers[i+1] > numbers[i+2]) || (numbers[i] > numbers[i+1] && numbers[i+1] < numbers[i+2])) { | |
arr.push(1) | |
} else { | |
arr.push(0) | |
} | |
} |
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
// Registra a diretiva personalizada global chamada `v-focus` | |
Vue.directive('focus', { | |
// Quando o elemento vinculado é inserido no DOM... | |
inserted: function (el) { | |
// Coloque o foco no elemento | |
el.focus() | |
} | |
}) |