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 countStrings(arr) { | |
// Objeto para armazenar a contagem dos termos | |
const counter = {}; | |
// Itera sobre cada item da lista | |
for (let str of arr) { | |
// Converte para minúsculas | |
const lowerStr = str.toLowerCase(); | |
// Incrementa a contagem |
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
import React from 'react'; | |
import { inject, observer } from 'mobx-react' | |
@inject('RootStore') | |
@observer | |
class App extends React.Component { | |
adicionarUsuario = () => { | |
if (this.usuario.value == '') |
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
import { observable, action, computed } from 'mobx'; | |
class RootStore { | |
@observable usuarioLogado = 'Vinicius Gonzalez'; | |
@observable listaUsuarios = []; | |
@action addUsuario = (usuario) => { | |
this.listaUsuarios.push(usuario); | |
} |
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
import React from 'react'; | |
import ReactDOM from 'react-dom'; | |
import './index.css'; | |
import App from './App'; | |
import * as serviceWorker from './serviceWorker'; | |
import { Provider } from 'mobx-react'; | |
import RootStore from '../src/mobx/RootStore'; | |
const Root = ( |
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
namespace Stopwatch01 | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
// Instancia um objeto do tipo Stopwatch | |
Stopwatch watch = new Stopwatch(); | |
// Conexão com o banco de dados de teste |