Skip to content

Instantly share code, notes, and snippets.

View geraldotech's full-sized avatar
🎯
Focusing

Geraldo Costa Filho geraldotech

🎯
Focusing
View GitHub Profile
@geraldotech
geraldotech / hasAttribute_setAttribute.html
Created June 20, 2022 01:45
reduce && hasAttribute_setAttribute
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
code {
font-size: 2rem;
const n = [2,4,6,1,7];
x = n.reduce(function (total,el,ind,arr) {
console.log(`index: ${ind}`)
console.log(`total: ${total}`)
console.log(`el: ${el}`)
console.log(`Arr: ${arr}`)
return total+= el;
},0);
console.log(x) //20
@geraldotech
geraldotech / filter.js
Created June 19, 2022 19:58
Filter Obj Array && console.warn
busca2 = animais.filter((value)=> value.tipo === 'gato');
busca2.length != 0 ? console.log(busca2) : console.warn('404')
@geraldotech
geraldotech / fetch-async-await.js
Last active July 27, 2022 22:40
parse response.json to json obj
const api = 'http://127.0.0.1/Dev/Javascript/JSON/my_local_json/dados2.json';
async function essaurl(url){
const response = await fetch(url);
const data = await response.json();
if(response){
show(data)
}
@geraldotech
geraldotech / AngularJS.html
Last active June 18, 2022 16:00
AngularJS
<li>np-app</li>
<li>ng-model</li>
<li>ng-bind</li>
<li>ng-init</li>
<li>ng-controller (if exist ng-app :before it doest work!)</li>
<li>parent</li>
<li>ng-show</li>
<li>ng-hide</li>
<li>ng-if</li>