You can treat the string as an array - try console.logging "abc"[2]

On Sat, May 7, 2011 at 11:46 AM, radiate <david.bou...@gmail.com> wrote:

> Hi,
>
> New to javascript.  I'm reading Object Oriented Javascript and need
> assistance/inspiration for one of the exercises:
>
> The exercise calls for the creation a constructor function that
> creates (among other things) a split method that acts like the String
> object's equivalent.  The catch is that we aren't supposed to use any
> built-in String functions.  I've been able to replicate several String
> methods but this has me stuck.
>
> The code should operate as follows:
>
> var s = new MyString('hello');
> s.split('e');
>
> returns ["h", "llo"]
>
>
> Any ideas suggestions would be appreciated.  Thanks.
>
> --
> To view archived discussions from the original JSMentors Mailman list:
> http://www.mail-archive.com/jsmentors@jsmentors.com/
>
> To search via a non-Google archive, visit here:
> http://www.mail-archive.com/jsmentors@googlegroups.com/
>
> To unsubscribe from this group, send email to
> jsmentors+unsubscr...@googlegroups.com
>



-- 
Arieh Glazer
אריה גלזר
052-5348-561
http://www.arieh.co.il
http://www.link-wd.co.il

-- 
To view archived discussions from the original JSMentors Mailman list: 
http://www.mail-archive.com/jsmentors@jsmentors.com/

To search via a non-Google archive, visit here: 
http://www.mail-archive.com/jsmentors@googlegroups.com/

To unsubscribe from this group, send email to
jsmentors+unsubscr...@googlegroups.com

Reply via email to