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
// The task is to implement generateOrderSummary function | |
const users = [ | |
{ id: 1, name: 'Alice', age: 30 }, | |
{ id: 2, name: 'Bob', age: 25 }, | |
{ id: 3, name: 'Charlie', age: 35 } | |
]; | |
const products = [ |
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
// The task is to implement multiselect from scratch (styling is not required) | |
// While closed it should show selected items separated by coma, | |
// on click it should open a list where you can check/uncheck items | |
const Component = () => { | |
const [items, setItems] = React.useState([]) | |
const [selected, setSelected] = React.useState([]) | |
const [isOpen, setIsOpen] = React.useState(false); |
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
import "./styles.css"; | |
import PeopleList from "./PeopleList"; | |
export default function App() { | |
const peopleIds = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; | |
return <PeopleList ids={peopleIds} />; | |
} |
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
// Task is to implement scroll to section for buttons in the menu without anchoring | |
const Component = () => { | |
const section2Ref = React.useRef(null); | |
const section3Ref = React.useRef(null); | |
const section4Ref = React.useRef(null); | |
const scrollToSection = (sectionRef) => { | |
if (sectionRef.current) { |
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
// Implement animation for gradient on hover | |
const Component = () => { | |
return ( | |
<div className="container"> | |
<button>BUTTON</button> | |
</div> | |
) |
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
const axios = require('axios') | |
const cheerio = require('cheerio') | |
const urlParser = require("url"); | |
const fs = require("fs"); | |
function replaceCommaLine(data) { | |
//convert string to array and remove whitespace | |
let dataToArray = data.split(',').map(item => item.trim()); | |
//convert array to string replacing comma with new line | |
return dataToArray.join("\n"); |