Giter Site home page Giter Site logo

eesanchez22 / flw2-u2l8-23-24-part-2 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from itscodenation/flw2-u2l8-23-24-student-exercise-part-2

0.0 0.0 0.0 27 KB

Home Page: replit.com/@CN-Mika/flw2-u2l8-23-24-student-exercise-part-2

JavaScript 54.10% CSS 23.75% HTML 22.15%

flw2-u2l8-23-24-part-2's Introduction

FLW2 U2L8 Code Solo: Import/Export

Coin Flipper

In this app:

  • The user clicks a button and the coin lands on either heads or tails.
  • It keeps track of how many times the coin has landed on each.

Instructions

USE COMMENTS AS CLUES!

  • You'll find lots of comments in the Flip component, where you'll want to write specific parts of your code.
  • Feel free to delete the comments when you're finished, keep them up, or change them. Remember, leaving comments is another great practice!

  1. In the return statement of the Flip component, there is an image of a coin that changes from heads to tails depending on the state of the coinSide variable.
    • The syntax may be unfamiliar, but it's using what's called a "ternary" expression.
    • Essentially, it's an if/else statement but written a little differently.
    • These are easier to use in React when it comes to conditionally returning elements.

  1. You won't be passing any functions as props in this assignment! Since we're building out everything our Flip component, we'll have everything we need.

Bonus Challenge!

  • Add a button that resets the heads & tails count back to 0 and changes the coin image back to heads.
  • You'll need to build a function and add it as an event handler to the button.
  • Look back to the Counter app for syntax help!

flw2-u2l8-23-24-part-2's People

Contributors

cn-mika avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.