Skip to content

Instantly share code, notes, and snippets.

View PrimeTimeTran's full-sized avatar
🎯
Focusing

Loi Tran PrimeTimeTran

🎯
Focusing
View GitHub Profile
# Number Guessing Game (Basic)
Congratulations, you're on your way to learning JavaScript. For your final Day 1 assignment, you'll have to build a simple number guessing game.
Doing this assignment will test your ability to use variables, functions, and (optionally, if you're brave!) Arrays. We'll cover Arrays in depth next week, but if you want to try now, go ahead!
## Milestone 0: Draw a Picture
![](https://i.imgur.com/KZVZMOT.png)
{
"candidates": [
{
"id": 69,
"first_name": "Carola",
"last_name": "Linsley",
"email": "clinsley1w@businessweek.com",
"gender": "Female",
"country": "Brazil",
"job_title": "VP Marketing",
const http = require('http');
const request = require('request');
require('dotenv').config();
const clientId = process.env.REACT_APP_CLIENT_ID;
const secretKey = process.env.REACT_APP_SECRET_KEY;
console.log('started server on port 5000');
http.createServer((req, res) => {
const girlfriends = [
{ isHappy: false, name: 'Binna', likesMovies: false, likesFlowers: true, favoriteFlowerColor: 'red' },
{ isHappy: true, name: 'Vivian', likesMovies: false, likesFlowers: true },
{ isHappy: false, name: 'Tram', likesMovies: true, likesFlowers: false },
{ isHappy: true, name: 'Diep', likesMovies: true, likesFlowers: true },
]
function takeToMovie(girlfriend) {
console.log('Loi is taking ' + girlfriend.name + ' to the movies')
}
function buyFlowers(girlfriend) {
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Todo List</title>
<meta name="description" content="Todo List">
<meta name="author" content="SitePoint">
document.getElementById("todoInput").focus()
const node = document.getElementById("todoInput");
node.addEventListener("keyup", (e) => {
if (e.key === "Enter") {
addTodo()
}
});
const todos = [
{ done: true, body: 'Go to School'},
{ done: false, body: 'Have some coffee'},
@PrimeTimeTran
PrimeTimeTran / ElCaptain.js
Last active July 29, 2019 06:28
Elcapitan
const people = [
{
id: 1,
firstName: "Loi",
lastName: "Tran",
age: 18,
favoriteColor: "red",
favoriteColors: ["red", "white", "blue"],
favoriteSingers: ["Mariah Carey", "Justin Bieber", "Britney Spears"],
nationality: "U.S.A.",
import React, { useState, useEffect } from 'react';
import './App.css';
function App() {
const [cart, setCartItem] = useState({ items: [] })
const getCart = async() => {
const cart = await localStorage.getItem('cart')
if (cart) {
const cartObject = {
export const CITIES = [
{
name: "Saigon",
latitude: 10.817141,
longitude: 106.707954,
imgUrl: [
"http://i.imgur.com/99KyJ5N.jpg",
"https://wallpapercave.com/wp/wp4190043.jpg",
"https://mfiles.alphacoders.com/701/701818.jpg",
"https://mfiles.alphacoders.com/702/702637.jpg",
[
{
"id": 1,
"first_name": "Carmelina",
"last_name": "Peasey",
"email": "cpeasey0@bloglovin.com",
"gender": "Female",
"ip_address": "155.168.48.181",
"avatar_url": "https://robohash.org/necessitatibuseiusquasi.png?size=50x50&set=set1",
"last_message_content": "Curabitur at ipsum ac tellus semper interdum. Mauris ullamcorper purus sit amet nulla. Quisque arcu libero, rutrum ac, lobortis vel, dapibus at, diam.",