What does "with" do in JavaScript?

Posted by streetparade on Stack Overflow See other posts from Stack Overflow or by streetparade
Published on 2010-03-29T13:53:21Z Indexed on 2010/03/29 14:03 UTC
Read the original article Hit count: 145

I saw JavaScript code which begins with with. That's a bit confusing. What does it do and how can it be used correctly?

with (sObj) return options[selectedIndex].value;

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about hidden-features

  • Hidden features of MySQL

    as seen on Server Fault - Search for 'Server Fault'
    In the long tradition of having hidden features, let us have a list of hidden features in MySQL. Do put one feature per answer. Also See: Hidden Features of Linux Hidden Features of PowerShell Hidden features of Oracle Database Hidden Features of Windows 2008 Hidden Features of Solaris/OpenSolaris Hidden… >>> More

  • Hidden features of Bash

    as seen on Stack Overflow - Search for 'Stack Overflow'
    Shell scripts are often used as glue, for automation and simple one-off tasks. What are some of your favorite "hidden" features of the Bash shell/scripting language? One feature per answer Give an example and short description of the feature, not just a link to documentation Label the feature using… >>> More

  • Hidden features of classic asp

    as seen on Stack Overflow - Search for 'Stack Overflow'
    I am still a fan of Classic ASP and know a lot of developers still using classic ASP, although by far there are very few features available in ASP, let us list out the most useful and not so well known ones Of course the question is on the lines of the Hidden Features questions listed below.: Hidden… >>> More

  • Hidden features of Python

    as seen on Stack Overflow - Search for 'Stack Overflow'
    What are the lesser-known but useful features of the Python programming language? Try to limit answers to Python core One feature per answer Give an example and short description of the feature, not just a link to documentation Label the feature using bold title as the first line This question… >>> More

  • Hidden Features of MXML

    as seen on Stack Overflow - Search for 'Stack Overflow'
    What are some of the hidden features of MXML? MXML being used in Flex Framework became quite popular language (because Flash Player is something every PC has and Flash Builder, Flash Catalist are quite popular Adobe programms) So at least from the existing features, do you know any that are not… >>> More