Array and String Manipulation Mastery Quiz Quiz

  1. Finding Duplicates in Arrays

    Given the array [3, 1, 4, 1, 5], which number is a duplicate?

    1. 1
    2. 3
    3. 4
    4. 5
    5. None
  2. Reversing a String

    What is the result of reversing the string 'array'?

    1. yarrA
    2. yarra
    3. arraY
    4. yaray
    5. array
  3. Searching for an Element

    Which JavaScript method returns the first index at which a given element can be found in an array?

    1. indexOf
    2. findIndexOf
    3. getIndex
    4. search
    5. findPosition
  4. Splitting Strings

    What does 'hello,world'.split(',') return?

  5. Joining Array Elements

    If arr = ['a', 'b', 'c'], what does arr.join('-') return?

    1. a-b-c
    2. abc
    3. a,b,c
    4. a b c
    5. a-b,c
  6. Case Transformation

    What is the output of 'MiXeD'.toLowerCase()?

    1. mixed
    2. MIXED
    3. MixEd
    4. MiXeD
    5. mIxEd
  7. Removing the Last Array Element

    Which array method removes the last element from an array?

    1. pop
    2. push
    3. shift
    4. splice
    5. removeLast
  8. Finding the Length

    What is the value of ['apple', 'banana', 'orange'].length?

    1. 3
    2. 2
    3. 1
    4. 4
    5. 0
  9. Array to String Conversion

    What does ['2024', 'quiz'].toString() return?

    1. 2024,quiz
    2. 2024quiz
    3. ['2024','quiz']
    4. 2024:quiz
    5. 2024 quiz
  10. Checking Presence in String

    What does 'banana'.includes('nan') return?

    1. true
    2. false
    3. null
    4. undefined
    5. NaN