You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
10 years ago | |
|---|---|---|
| .. | ||
| .gitkeep | 10 years ago | |
| README.md | 10 years ago | |
README.md
W02D02 Morning Warmup
####Exercises 1: Find a value in a given array
- Write a function
searchArraythat takes an array and value as parameters and searches the array for the given value. If the value is in the array, returntrue, otherwise return '-1'.
var nums = [1,2,3,4,5]
searchArray(nums, 3) => true
searchArray(nums, 6) => -1
Here is some starter code:
var searchArray = function(array,value) {
};
Exercises 2: Determine whether a given string is a palindrome
- Write a function
isPalindromethat takes in a single parameterstr, a string, and returnstrueif the string is a palindrome, and false otherwise. For example
isPalindrome('hello') => false
isPalindrome('hannah') => true
Here is some starter code:
var isPalindrome = function(str) {
};
