Skip to content

Latest commit

 

History

History
65 lines (34 loc) · 1.42 KB

File metadata and controls

65 lines (34 loc) · 1.42 KB

Do all of the below in Chrome debugging console. If you get stuck learn to debug.

Create a github repo and commit your answers regularly inside the repo.

Use this repo as a template of how to structure your github.

1

var firstName = 'Richard'
var lastName = 'Gill'

console.log 'Richard Gill'

2

Write a function firstNameLastName(firstName, lastName)

Which concateonates the names together with a space between.

3

Write a function lastNameFirstName(firstName, lastName)

Which concateonates the names together like this: 'Gill, Richard' (with a comma)

4

var firstName = 'Richard'

print the length of the var (7).

5

var people = ['Jack', 'John', 'James']

Using people print out all these names to the console.

Like this:

Jack
John
James

Note: Your answer should work for a var people of any length. E.g. var people = ['Jack'] or var people = ['Jack', 'John']

6

Write a function which takes a name and returns the name without the first character.

7

Write a function which takes a name and returns the name without the first character, but only if the name starts with a 'J'

8

Write a function which takes a name and returns the name without the first character, but only if the name starts with a 'J', if the name starts with an 'R' remove the last two characters.