You are going to be given an array of elements. Your job is to return an array which has duplicated each element
[1,2] => [1, 1, 2, 2]
['a', 'b'] => ['a', 'a', 'b', 'b']
// src/App.js | |
import { useState } from 'react' // state hook | |
import './App.css'; | |
import Task from './components/Task' | |
const initialTasks = [ | |
{ id: 1, text: 'Go shopping', completed: false }, | |
{ id: 2, text: 'Work out', completed: false }, | |
{ id: 3, text: 'See the doctor', completed: true } | |
] |
// add to the top of build.gradle | |
import org.gradle.api.tasks.testing.logging.TestExceptionFormat | |
import org.gradle.api.tasks.testing.logging.TestLogEvent | |
// add to the bottom of build.gradle | |
tasks.withType(Test) { | |
testLogging { | |
// set options for log level LIFECYCLE | |
events TestLogEvent.FAILED, | |
TestLogEvent.PASSED, |
// using classes together | |
// lower cohesion | |
class SecretDiary { | |
constructor() { | |
this.entries = [] | |
this.isLocked = true | |
} | |
lock() { |
success (noun)
The achievement of one's aim or goal
The Academy is designed to help you prepare for success in the world. We have carefully crafted the learning environment to give you the best resources available to achieve your goals, but the responsibility is yours alone to take advantage of them. From the smallest living-room start-up to the most successful multinational, from community enterprises to the world's most impactful charities, throughout history people have taken responsibility to aim for a goal, bringing about the world they wanted to live in.
The goal-related skills you develop here will help you take control of your career and your life. The technical, communication, and learning skills you’ll improve on will give you the most powerful tools that presently exist for achieving those goals.
Fill out the quick survey as we wait for everyone to join and then there'll be a welcome to the session, then there'll be a short introduction to Digital Futures followed by small group introductions.
// using class component and lifecycle method to manage lifecycle event: ComponentDidMount | |
import React, { Component } from 'react' | |
class Headlines extends Component { | |
constructor(props) { | |
super(props) | |
this.state = { items: [] } | |
} | |
componentDidMount() { |
// using class component to manage state | |
import React, { Component } from 'react' | |
class Counter extends Component { | |
constructor(props) { | |
super(props) | |
this.state = { counter: 0 } | |
} | |
addOne = () => { |