Skip to content

My pull request#14

Open
elvisonob wants to merge 12 commits intoboolean-uk:mainfrom
elvisonob:main
Open

My pull request#14
elvisonob wants to merge 12 commits intoboolean-uk:mainfrom
elvisonob:main

Conversation

@elvisonob
Copy link

No description provided.

// TODO: write code in this function body to pass the tests
// TODO: write code in this function body to pass the tests

if (num >= lower && num <= upper) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

an if statement is not needed here you can just return the boolean, like this:

return num >= lower && num <= upper

function isHelloOrGoodbye(val1) {

// TODO: write code in this function body to pass the tests
if (val1 === 'Hello' || val1 === 'Goodbye') {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here just return the boolean

function isArrayEmpty(array) {

// TODO: write code in this function body to pass the tests
if (array.length === 0) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here just return the boolean


// TODO: write code in this function body to pass the tests
// TODO: write code in this function body to pass the tests
if (num1 > num2) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here just return the boolean

function isHello(val1) {

// TODO: write code in this function body to pass the tests
if (val1 === 'Hello') {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here just return the boolean

// TODO: write code in this function body to pass the tests
// TODO: write code in this function body to pass the tests
if (val1 !== 'Hello') {
return true

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here just return the boolean

function isLongerThan(val1, val2) {

// TODO: write code in this function body to pass the tests
if (val1.length > val2.length) { return true } else {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here just return the boolean

counts++
}
}
if (counts % 2 !== 0) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here just return the boolean (the condition)


// Set fourthCity to the 4th element in the cities array
const fourthCity = ''
const fourthCity = 'Delhi'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have hard coded this, but should be accessing the 3rd element in the array:

cities[3]


// Set firstCity to the 1st element in the cities array
const firstCity = ''
const firstCity = 'London'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

again should not be hard coded

// use an array method to remove the last item from the fruits array and store the value in the pear variable
const pear = fruits.undefined
const pear = 'Pear'
fruits.pop('Pear')

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the assignment on line 31 is unnecessary, also line 32 you don't need to pass an argument/param to .pop(). You just need :

fruits.pop()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants