-
- Não é um software
- Não é uma biblioteca ou framewok
- Modelo
| const clearCPF = cpf => cpf.replace(/\D/g, '') | |
| const validLength = cpf => cpf.length === 11 | |
| const redundant = cpf => cpf.split('').every(x => x === cpf[0]) | |
| const restOrZero = amount => (amount === 10 || amount === 11) ? 0 : amount | |
| const calculateDigits = cpf => { | |
| const numsStr = cpf.split('') | |
| const arrNums = Array.from(numsStr, n => +n) | |
| const nineDigits = arrNums.slice(0,9) | |
| const tenDigits = arrNums.slice(0,10) |
| const arr = [1, 2, 3, 4, 1, 5, 1, 6, 1, 7, 7, 42, 42, 42, 42, 42] | |
| const findMostRecurrent = param => { | |
| return param.reduce((acc, curr, index, base) => { | |
| const currSum = base.filter( it => it === curr).length | |
| const newAcc = { ...acc, [curr]: currSum } | |
| if (++index == base.length) { | |
| const arrObj = Object.keys(newAcc) | |
| .map(it => ({ [it]: acc[it] })) |
| import { useState } from 'react' | |
| // custom hook .................useFile.......................... | |
| const useInputFile = () => { | |
| const [file, setValue] = useState('') | |
| function getBase64({target}) { | |
| const fileToLoad = target.files[0] | |
| const FR = new FileReader() | |
| FR.onload = (event) => { | |
| return setValue(event.target.result) | |
| } |
| var React = require('react') | |
| var loginPage = React.createClass({ | |
| getInitialState: function () { | |
| return { | |
| token: null, | |
| user: null, | |
| badLogin: null | |
| } |
| <!DOCTYPE html> | |
| <html ng-app="app"> | |
| <head> | |
| <title>skill</title> | |
| <meta charset="utf-8" /> | |
| </head> | |
| <body> | |
| <section ng-view></section> | |
| <script type="text/javascript" src="lib/angular.min.js"></script> | |
| <script type="text/javascript" src="lib/angular-route.min.js"></script> |
| (function () { | |
| 'use strict'; | |
| angular | |
| .module('app') | |
| .directive('imgUpload', Upload) | |
| function Upload () { | |
| var directive = { | |
| restrict: 'AE', | |
| scope: { |