1. 17:40 20th Nov 2010

    Notes: 38

    Reblogged from rentzsch

    Tags: javascript

    rentzsch:

    A common operation is “does this list already have this item in it?”.

    The obvious solution is to use arrays for the list of items and indexOf() as the detection method:

    var flintstones = ['fred', 'wilma', 'pebbles'];
    assert(flintstones.indexOf('wilma') !==...
     
    1. krumviedaieft95954 reblogged this from rentzsch
    2. strictlandiirh26332 reblogged this from rentzsch
    3. marciooya reblogged this from webvampires
    4. cincijs reblogged this from rentzsch
    5. webvampires reblogged this from rentzsch
    6. fooyeahcode reblogged this from rentzsch
    7. number13 reblogged this from rentzsch
    8. rentzsch posted this