Git Product home page Git Product logo

wdi7-quiz2's Introduction

Quiz #2

Instructions

  1. Fork this repo
  2. Clone your fork
  3. Fill in your answers by writing in the appropriate area, or placing an 'x' in the square brackets (for multiple-choice questions).
  4. Add/Commit/Push your changes to Github.
  5. Open a pull request.

CSS

Question #1

Describe the purpose of a clearfix in CSS, and give an example of how to do it.

Your Answer: It helps correct a problem with floating images when they are larger than their container. Example: .clear:after { clear: both; }

Question #2

What does the following selector do? ul.dropdown > li?

Select 1:

[X] Selects all li's which are directly inside a ul of class dropdown (children)
[] Selects all li's which are anywhere inside a ul of class dropdown (any descendant)
[] Selects all ul's of class dropdown, as well as the children elements that are li's
[] Selects all ul's of class dropdown, only if their children are exclusively li's

Scope/Context/Closures

Question #3

Describe the rules of scope in JavaScript.

Your Answer: Scope can be local or global. Global scope affects all scripts and functions that a web page can access, while local scope only affects variables contained within a given function.

Question #4

Define an object and store it in a variable pizza. The object should have 2 properties: a temperature (set to 70), and a method called bake. When called, this method should set the pizza's temperature to be 300. Note: you may not use the variable pizza inside your method.

Your Answer:

Callbacks

Question #5

Define a function called doSomething. It should take one argument, called thingToDo. When called, doSomething should invoke the function given as an argument. Finally, demonstrate calling doSomething with a function.

Your Answer:

// write code here

Question #6

What is the difference between synchronous and asynchronous program execution?

Select all that apply:

[] Synchronous code runs at an even pace, asynchronous code runs with uneven pacing.
[] Synchronous code runs all at the same time, asynchronous code runs completely randomly
[X] Synchronous code runs in order (as appears in the source), asynchronous code may run at a later time.

Git

Question #7

Which of the following represents a correct workflow for submitting a PR on a non-master branch? (ignore the lack of commit messages)

Select 1:

[X] fork on github; git clone <fork_url>; git checkout -b <charlie_solution>; git add <files>; git commit; git push; create pull request
[] fork on github; git clone <ga_dc_url>; git checkout -b <charlie_solution>; git add <files>; git commit; git push; create pull request
[] git clone <ga_dc_url>; git branch <charlie_solution>; git add <files>; git commit; git push; create pull request
[] fork on github; git clone <fork_url>; git checkout -b <charlie_solution>; git add <files>; git commit; git pull; create pull request

jQuery

Question #8

Which of the following statements will work, assuming jQuery is loaded?

Select all that apply:

[X] `$(".post").css("background", "peachpuff")`
[] `$(".post").innerHTML`
[] `$(".post").html()`
[] `document.getElementsByClassName("post")[0].innerHTML`
[] `document.getElementsByClassName("post").innerHTML`

Question #9

Using jQuery, add an event listener for clicks on the button with the id 'greeting'. When the event happens, the code should append a paragraph to the body, that says "hello".

Your Answer: $("#greeting").click(function(){ $(body).append("

hello

"); });

Software Development Processes

Question #10

Create a repo for project 1. (You don't need to fork, just create a brand new repo).

Create a readme.md in that repo. In the readme, write out five (5) user stories for your first project. Be sure to include a role, goal, and reason for each.

Finally, link to your repo on github in the space below.

Your Answer: https://github.com/tkentor/Project-1.git

wdi7-quiz2's People

Contributors

adambray avatar mattscilipoti avatar tkentor avatar

Watchers

James Cloos avatar  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.