String_array is not an array


#1

https://www.codecademy.com/courses/learn-ruby/lessons/data-structures/exercises/arrays-of-non-numbers?action=lesson_resume

It looks like string_array isn’t an array.
undefined local variable or method `string’ for #Context:0xb171dc



string_array = [string, array]


#2

If you write the code like that
the interpreter will be looking for a variable string and a variable array
A_string_ is like "i am a string"
An empty array is like []


#3

but no matter what i type I get the same result


#4

Then use
string_array=["a","b","c"]


#5

I still get an error


#6

could you share that EXACT error-message


#7

I get the same error for
string_array [“who”,“what”,“where”]


#8

They want you
to give the variable string_array an associated Array-Value, and the array should contain string-items
like
var string_array =[“who”,“what”,“where”];


#9

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.