Skip to content

Instantly share code, notes, and snippets.

View mauricior's full-sized avatar
🏠
Working from home

Mauricio Reis mauricior

🏠
Working from home
  • Sampa, Brazil
View GitHub Profile
// Examples of https://medium.com/@alvaro.saburido/set-theory-for-arrays-in-es6-eb2f20a61848
const arrA = [1, 3, 4, 5];
const arrB = [1, 2, 5, 6, 7];
const intersection = arrA.filter((x) => arrB.includes(x));
console.log('Intersection: ', intersection);
console.log('Expected: [1,5]');
const difference = arrA.filter((x) => !arrB.includes(x));
console.log('\nDifference: ', difference);
@mauricior
mauricior / 01-simple.test.js
Created August 8, 2018 18:52 — forked from a-h/01-simple.test.js
Testing styled Material UI components with Enzyme
import React from 'react';
import { shallow } from 'enzyme';
const Item = text => <p>Item {text}</p>;
const Composition = ({ showB }) => (
<p>
<Item text="A" />
{showB && <Item text="B" />}
</p>);