Coder Social home page Coder Social logo

reemalchal / task-js-variables-profile Goto Github PK

View Code? Open in Web Editor NEW

This project forked from joincoded/task-js-variables-profile

0.0 0.0 0.0 16 KB

In this task, you will learn about variables and how to interpolate strings together

JavaScript 70.06% CSS 8.75% HTML 21.19%

task-js-variables-profile's Introduction

Variables

After this task you should be able to have a better understanding of variables, constants, and string interpolation.

Instructions

  • Fork, and clone this repo to your development folder.
  • Open the repo in finder and double click on index.html.
    This will open the website using Chrome.
  • After every edit you must save, go to the browser, and refresh the page
  • Only edit index.js file, don't touch any other files
  • ๐Ÿ”ด DON'T MAKE ANY CHANGES ON index.html.
    This is a lesson about variables not HTML.

1. Variable and Constants (Easy Peasy Lemon Squeezy ๐Ÿ‹)

In index.js you should define the following variables with these exact names:

  1. fullName -> assign it a value of your full name
  2. yearOfBirth -> assign it a value of your year of birth
  3. hobby -> assign it a value of your favorite hobby
  4. funFact -> assign it a value of some fun fact about yourself
  5. image -> assign it a value of a url of your image or any image that represents you online

This what it should look like

screenshot

2. String Interpolation (Challenging ๐Ÿคผโ€โ™€๏ธ)

This website isn't very informative. It would be better if the information was displayed in a nicer way.
Let's use the variables we already created to make some new fancy strings of text.

Create the following new variables with these exact names and containing these interpolated strings:

  1. fullNameString -> assign it to: "My name is {YOUR_FULL_NAME}"
  2. yearOfBirthString -> assign it to: "I am {YOUR_AGE}" (make sure you calculate your age from your year of birth)
  3. hobbyString -> assign it to: "My hobby is {YOUR_HOBBY}"

This what it should look like

screenshot

3. Reassignment (Spciy ๐ŸŒถ)

You might have noticed the buttons and the stars at the bottom of the page. This is your hacker-score! Pressing the buttons should update it, but it's not working!

In index.js we've defined a stars variable:

let star = 0;

We've also deifned four functions (more on functions later) called incrementBy1, incrementBy2, decrementBy1, and decrementBy2.

Your job is to write the code inside those functions that will update the value of stars! Good luck!

task-js-variables-profile's People

Contributors

octowl avatar omsi96 avatar reemalchal 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.