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
// Uses Audio() to play an mp3 | |
function sound() { | |
var audio = new Audio(); | |
audio.src = "url to mp3"; | |
audio.play(); | |
} |
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 React, { Component } from 'react'; | |
import ReactDOM from 'react-dom'; | |
import axios from "axios"; | |
export default class App extends Component { | |
constructor(props) { | |
super(props); | |
this.state = { | |
posts: [] |
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
// Compare two arrays and determine if they have the same values in the same order | |
var compare = arr1.length == arr2.length && | |
arr1.every(function(element, index){ | |
return element == arr2[index]; | |
}); | |
if(compare) { | |
// Arrays match, do this | |
} |
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
// Generates and logs a random number between 1 and 4, pushes it to an array, and logs it | |
var arr = []; | |
function randomNumber() { | |
var num = Math.floor((Math.random() * 4) + 1); | |
arr.push(num); | |
console.log(arr); | |
} |
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
// loop over the array using the iteratee function at the specified interval | |
function intervalForEach(array, iteratee, delay) { | |
let current = 0 | |
let interval = setInterval(() => { | |
if (current === array.length) { | |
clearInterval(interval) | |
} else { |
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 React, { Component } from 'react'; | |
import './App.css'; | |
export default class ToDoList extends Component { | |
constructor(props) { | |
super(props); | |
this.state = { | |
userInput: '', | |
list: [] |
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 React, { Component } from 'react'; | |
import './App.css'; | |
export default class ToDoList extends Component { | |
constructor(props) { | |
super(props); | |
this.state = { | |
userInput: '', | |
list: [] |
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
<?xml version="1.0" encoding="utf-8"?> | |
<!-- Generator: Adobe Illustrator 21.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> | |
<svg version="1.1" id="spaceship_launch_illustration" | |
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="1400px" height="980px" | |
viewBox="0 0 1400 980" enable-background="new 0 0 1400 980" xml:space="preserve"> | |
<g id="background"> | |
<rect fill="#4A626E" width="1400" height="980"/> | |
<g> | |
<path fill="#405059" d="M1196.4,552.4C1196.4,278.2,974.1,56,700,56S203.6,278.2,203.6,552.4c0,182.1,98.1,341.3,244.3,427.6 | |
h504.2C1098.3,893.6,1196.4,734.5,1196.4,552.4z"/> |
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
class MyApp extends React.Component { | |
constructor(props) { | |
super(props); | |
this.state = { | |
name: 'CamperBot' | |
} | |
} | |
render() { | |
return ( | |
<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
import React, { Component } from 'react'; | |
import logo from './logo.svg'; | |
import './App.css'; | |
class App extends Component { | |
constructor(props) { | |
super(props); | |
this.state = { | |
data: [[1,1,0,1,1,1],[1,1,1]] |
OlderNewer