Dictionary Contains Key

Benchmark created by styfle on


Description

Compare different ways to implement a Dictionary and test the ContainsKey() method.

Setup

var dict = {
     "0": "http://stackoverflow.com/q/28051066?rq=1",
     "1": "http://stackoverflow.com/q/17984300?rq=1",
     "2": "http://stackoverflow.com/q/32911493?rq=1",
     "3": "http://stackoverflow.com/q/19353294?rq=1",
     "6": "http://stackoverflow.com/q/3498817?lq=1",
     "9": "http://stackoverflow.com/q/16065028?lq=1",
     "11": "http://stackoverflow.com/q/8153963?lq=1",
     "106": "http://stackoverflow.com/q/385042?lq=1",
     "719": "http://stackoverflow.com/q/113045?rq=1",
     "981": "http://stackoverflow.com/q/133031?rq=1",
     "current community": "http://stackoverflow.com/",
     "chat": "http://chat.stackoverflow.com/",
     "log out": "http://stackoverflow.com/users/logout",
     "Stack Overflow": "http://stackoverflow.com/",
     "Meta Stack Overflow": "http://meta.stackoverflow.com/",
     "Stack Overflow Careers": "http://careers.stackoverflow.com/",
     "your communities": "http://stackexchange.com/users/98473/?tab=accounts",
     "edit": "http://stackoverflow.com/posts/9267066/edit",
     "cancel": "http://stackoverflow.com/questions/1334143/sql-server-datetime2-vs-datetime#",
     "Stack Overflow\n            2,702": "http://stackoverflow.com/",
     "Ask Different\n            1,227": "http://apple.stackexchange.com/",
     "Christianity\n            653": "http://christianity.stackexchange.com/",
     "Biblical Hermeneutics\n            215": "http://hermeneutics.stackexchange.com/",
     "Cross Validated\n            187": "http://stats.stackexchange.com/",
     "reset to default list": "http://stackoverflow.com/questions/1334143/sql-server-datetime2-vs-datetime#",
     "more stack exchange communities": "http://stackexchange.com/sites",
     "company blog": "http://blog.stackoverflow.com/",
     "Stack Exchange": "http://stackexchange.com/",
     "Inbox": "http://stackoverflow.com/questions/1334143/sql-server-datetime2-vs-datetime#",
     "Reputation and Badges": "http://stackoverflow.com/questions/1334143/sql-server-datetime2-vs-datetime#",
     "2,702\n                        \n92749": "http://stackoverflow.com/users/266535/styfle",
     "review": "http://stackoverflow.com/review",
     "help": "http://stackoverflow.com/help",
     "Tour\n                            \n                                Start here for a quick overview of the site": "http://stackoverflow.com/tour",
     "Help Center\n                        \n                            Detailed answers to any questions you might have": "http://stackoverflow.com/help",
     "Meta\n                            \n                                Discuss the workings and policies of this site": "http://meta.stackoverflow.com/",
     "About Us\n                        \n                            Learn more about Stack Overflow the company": "http://stackoverflow.com/company/about",
     "Business\n                        \n                            Learn more about hiring developers or posting ads with us": "https://business.stackoverflow.com/?ref=topbar_help",
     "Questions": "http://stackoverflow.com/questions",
     "Jobs": "http://stackoverflow.com/jobs",
     "Tags": "http://stackoverflow.com/tags",
     "Users": "http://stackoverflow.com/users",
     "Badges": "http://stackoverflow.com/help/badges",
     "Ask Question": "http://stackoverflow.com/questions/ask",
     "SQL Server datetime2 vs datetime": "http://stackoverflow.com/questions/1334143/sql-server-datetime2-vs-datetime",
     "up vote": "",
     "down vote": "",
     "favorite": "http://stackoverflow.com/questions/1334143/sql-server-datetime2-vs-datetime#",
     "sql-server": "http://stackoverflow.com/questions/tagged/sql-server",
     "sql-server-2008": "http://stackoverflow.com/questions/tagged/sql-server-2008",
     "datetime": "http://stackoverflow.com/questions/tagged/datetime",
     "sql-server-2012": "http://stackoverflow.com/questions/tagged/sql-server-2012",
     "datetime2": "http://stackoverflow.com/questions/tagged/datetime2",
     "share": "http://stackoverflow.com/a/9267066/266535",
     "flag": "http://stackoverflow.com/questions/1334143/sql-server-datetime2-vs-datetime#",
     "edited Jul 31 '14 at 19:05": "http://stackoverflow.com/posts/1334143/revisions",
     "": "",
     "abatishchev": "http://stackoverflow.com/users/41956/abatishchev",
     "Mikeon": "http://stackoverflow.com/users/158801/mikeon",
     "add a comment": "http://stackoverflow.com/questions/1334143/sql-server-datetime2-vs-datetime#",
     "start a bounty": "",
     "active": "http://stackoverflow.com/questions/1334143/sql-server-datetime2-vs-datetime?answertab=active#tab-top",
     "oldest": "http://stackoverflow.com/questions/1334143/sql-server-datetime2-vs-datetime?answertab=oldest#tab-top",
     "votes": "http://stackoverflow.com/questions/1334143/sql-server-datetime2-vs-datetime?answertab=votes#tab-top",
     "Adam Porad": "http://stackoverflow.com/users/21353/adam-porad",
     "upvote": "",
     "FistOfFury": "http://stackoverflow.com/users/606725/fistoffury",
     "Jun 25 '14 at 20:49": "http://stackoverflow.com/questions/1334143/sql-server-datetime2-vs-datetime#comment37776720_1884088",
     "edited Jan 6 at 8:25": "http://stackoverflow.com/posts/1334193/revisions",
     "M4N": "http://stackoverflow.com/users/19635/m4n",
     "marc_s": "http://stackoverflow.com/users/13302/marc-s",
     "Triynko": "http://stackoverflow.com/users/88409/triynko",
     "Oct 26 '10 at 18:16": "http://stackoverflow.com/questions/1334143/sql-server-datetime2-vs-datetime#comment4318901_1334193",
     "JohnFx": "http://stackoverflow.com/users/30018/johnfx",
     "Jan 17 '11 at 17:15": "http://stackoverflow.com/questions/1334143/sql-server-datetime2-vs-datetime#comment5207612_1334193",
     "Jan 17 '11 at 17:40": "http://stackoverflow.com/questions/1334143/sql-server-datetime2-vs-datetime#comment5207899_1334193",
     "Adam Tuliper - MSFT": "http://stackoverflow.com/users/371637/adam-tuliper-msft",
     "Jun 1 '11 at 18:25": "http://stackoverflow.com/questions/1334143/sql-server-datetime2-vs-datetime#comment7223645_1334193",
     "stackoverflow.com/q/8421332/88409": "http://stackoverflow.com/q/8421332/88409",
     "Dec 8 '11 at 18:25": "http://stackoverflow.com/questions/1334143/sql-server-datetime2-vs-datetime#comment10424672_1334193",
     "show 5 more comments": "http://stackoverflow.com/questions/1334143/sql-server-datetime2-vs-datetime#",
     "edited Oct 26 '15 at 14:39": "http://stackoverflow.com/posts/32529042/revisions",
     "Baodad": "http://stackoverflow.com/users/450750/baodad",
     "Strange datetime behavior in SQL Server": "http://stackoverflow.com/questions/7157953/strange-datetime-behavior-in-sql-server?lq=1",
     "http://bytes.com/topic/sql-server/answers/578416-weird-millisecond-part-datetime-data-sql-server-2000-a": "http://bytes.com/topic/sql-server/answers/578416-weird-millisecond-part-datetime-data-sql-server-2000-a",
     "SQL Server 2008 and milliseconds": "http://stackoverflow.com/questions/8153963/sql-server-2008-and-milliseconds?lq=1",
     "http://improve.dk/archive/2011/06/16/getting-bit-by-datetime-rounding-or-why-235959-999-ltgt.aspx": "http://improve.dk/archive/2011/06/16/getting-bit-by-datetime-rounding-or-why-235959-999-ltgt.aspx",
     "http://milesquaretech.com/Blog/post/2011/09/12/DateTime-vs-DateTime2-SQL-is-Rounding-My-999-Milliseconds!.aspx": "http://milesquaretech.com/Blog/post/2011/09/12/DateTime-vs-DateTime2-SQL-is-Rounding-My-999-Milliseconds!.aspx",
     "edited Jun 20 '15 at 18:53": "http://stackoverflow.com/posts/9622463/revisions",
     "EBarr": "http://stackoverflow.com/users/215068/ebarr",
     "Aug 17 '12 at 19:20": "http://stackoverflow.com/questions/1334143/sql-server-datetime2-vs-datetime#comment16024904_9622463",
     "Aaron Bertrand": "http://stackoverflow.com/users/61305/aaron-bertrand",
     "Feb 11 '14 at 19:55": "http://stackoverflow.com/questions/1334143/sql-server-datetime2-vs-datetime#comment32830066_9622463",
     "Feb 13 '14 at 19:54": "http://stackoverflow.com/questions/1334143/sql-server-datetime2-vs-datetime#comment32923134_9622463",
     "ErikE": "http://stackoverflow.com/users/57611/erike",
     "Sep 23 '15 at 22:35": "http://stackoverflow.com/questions/1334143/sql-server-datetime2-vs-datetime#comment53341751_9622463",
     "Oleksandr": "http://stackoverflow.com/users/1353099/oleksandr",
     "this article": "http://blogs.msdn.com/b/cdnsoldevs/archive/2011/06/22/why-you-should-never-use-datetime-again.aspx",
     "edited Aug 18 '14 at 18:06": "http://stackoverflow.com/posts/25369156/revisions",
     "skrrgwasme": "http://stackoverflow.com/users/2615940/skrrgwasme",
     "jKlaus": "http://stackoverflow.com/users/2246014/jklaus",
     "Sam.Rueby": "http://stackoverflow.com/users/825011/sam-rueby",
     "Nov 13 '15 at 19:06": "http://stackoverflow.com/questions/1334143/sql-server-datetime2-vs-datetime#comment55171931_25369156",
     "Nov 17 '15 at 16:01": "http://stackoverflow.com/questions/1334143/sql-server-datetime2-vs-datetime#comment55290521_25369156",
     "chart": "http://technet.microsoft.com/en-us/library/bb677335.aspx",
     "SQLHINTS- DateTime Vs DateTime2": "http://sqlhints.com/tag/datetime-vs-datetime2/",
     "datetime2(Transact-SQL MSDN article)": "http://msdn.microsoft.com/en-us/library/bb677335.aspx",
     "MCTS Self-Paced Training Kit (Exam 70-432): Microsoft® SQL Server® 2008 - Implementation and Maintenance": "http://www.microsoft.com/learning/en/us/book.aspx?id=12858",
     "edited Dec 15 '13 at 8:39": "http://stackoverflow.com/posts/12364243/revisions",
     "imanabidi": "http://stackoverflow.com/users/184572/imanabidi",
     "James": "http://stackoverflow.com/users/2865852/james",
     "MSDN documentation": "http://msdn.microsoft.com/en-us/library/ms189491%28v=sql.105%29.aspx",
     "Richard Fawcett": "http://stackoverflow.com/users/431891/richard-fawcett",
     "Feb 11 '14 at 19:57": "http://stackoverflow.com/questions/1334143/sql-server-datetime2-vs-datetime#comment32830130_17236110",
     "Feb 11 '14 at 22:07": "http://stackoverflow.com/questions/1334143/sql-server-datetime2-vs-datetime#comment32834851_17236110",
     "Feb 11 '14 at 22:17": "http://stackoverflow.com/questions/1334143/sql-server-datetime2-vs-datetime#comment32835203_17236110",
     "Feb 11 '14 at 22:39": "http://stackoverflow.com/questions/1334143/sql-server-datetime2-vs-datetime#comment32835878_17236110",
     "Rhett A Brown": "http://stackoverflow.com/users/1207631/rhett-a-brown",
     "discard": "http://stackoverflow.com/questions/1334143/sql-server-datetime2-vs-datetime#",
     "ask your own question": "http://stackoverflow.com/questions/ask",
     "2 months ago": "http://stackoverflow.com/questions/1334143/sql-server-datetime2-vs-datetime?lastactivity",
     "What is the right way to ask for contemporary information of an old subject o…": "http://meta.stackoverflow.com/questions/318454/what-is-the-right-way-to-ask-for-contemporary-information-of-an-old-subject-on-s?cb=1",
     "User RSS Feeds: Feeding the Hand that Bites You?": "http://meta.stackoverflow.com/questions/318543/user-rss-feeds-feeding-the-hand-that-bites-you?cb=1",
     "Is “on-topic” defined by the Help Center or the community's de-facto reaction…": "http://meta.stackoverflow.com/questions/318545/is-on-topic-defined-by-the-help-center-or-the-communitys-de-facto-reaction-to?cb=1",
     "Strange ghost comment": "http://meta.stackoverflow.com/questions/318653/strange-ghost-comment?cb=1",
     "Oops! I didn't mean to do this.": "http://stackoverflow.com/questions/1334143/sql-server-datetime2-vs-datetime#",
     "Want a c# job?": "http://stackoverflow.com/jobs/tag/c%23",
     "Senior Software EngineerAdvanced Medical Reviewsremotec#.net": "http://stackoverflow.com/jobs/109400/senior-software-engineer-advanced-medical-reviews",
     "Full Stack Software EngineerSureIDPortland, ORc#asp.net": "http://stackoverflow.com/jobs/105307/full-stack-software-engineer-sureid",
     "Senior Application DeveloperNuOrbit MediaIndianapolis, INc#.net": "http://stackoverflow.com/jobs/108201/senior-application-developer-nuorbit-media",
     "Senior Software EngineerFOX SportsCincinnati, OHc#asp.net": "http://stackoverflow.com/jobs/109740/senior-software-engineer-fox-sports",
     "difference between DateTime and DateTime2": "http://stackoverflow.com/questions/3498817/difference-between-datetime-and-datetime2?lq=1",
     "SQL Server equivalent of MySQL's NOW()?": "http://stackoverflow.com/questions/385042/sql-server-equivalent-of-mysqls-now?lq=1",
     "SqlDateTime overflow when inserting value with DateTime.Now": "http://stackoverflow.com/questions/16065028/sqldatetime-overflow-when-inserting-value-with-datetime-now?lq=1",
     "find out the exact entity causing an exception in entity framework": "http://stackoverflow.com/questions/16347239/find-out-the-exact-entity-causing-an-exception-in-entity-framework?lq=1",
     "SQL Server DATEDIFF accuracy": "http://stackoverflow.com/questions/2719657/sql-server-datediff-accuracy?lq=1",
     "Unable to insert default DateTime of C# to SQL Server 2008": "http://stackoverflow.com/questions/16956003/unable-to-insert-default-datetime-of-c-sharp-to-sql-server-2008?lq=1",
     "Is there a reason not to use DateTime2?": "http://stackoverflow.com/questions/7739555/is-there-a-reason-not-to-use-datetime2?lq=1",
     "equivalent of PostgreSQL type “timestamp without time zone” in SQL Server": "http://stackoverflow.com/questions/21913563/equivalent-of-postgresql-type-timestamp-without-time-zone-in-sql-server?lq=1",
     "see more linked questions…": "http://stackoverflow.com/questions/linked/1334143?lq=1",
     "How to return the date part only from a SQL Server datetime datatype": "http://stackoverflow.com/questions/113045/how-to-return-the-date-part-only-from-a-sql-server-datetime-datatype?rq=1",
     "How to check if column exists in SQL Server table": "http://stackoverflow.com/questions/133031/how-to-check-if-column-exists-in-sql-server-table?rq=1",
     "How to convert .net DateTime to SQL Server DateTime2": "http://stackoverflow.com/questions/6176377/how-to-convert-net-datetime-to-sql-server-datetime2?rq=1",
     "For the .NET DateTime type, why is the inferred database type SqlDbTypes.DateTime instead of SqlDbTypes.DateTime2?": "http://stackoverflow.com/questions/8421332/for-the-net-datetime-type-why-is-the-inferred-database-type-sqldbtypes-datetim?rq=1",
     "SQL Server Query on todays date using datetime2": "http://stackoverflow.com/questions/15921964/sql-server-query-on-todays-date-using-datetime2?rq=1",
     "Why does the datetime type in SQL Server Compact round values?": "http://stackoverflow.com/questions/17984300/why-does-the-datetime-type-in-sql-server-compact-round-values?rq=1",
     "How do I calculate interval between two datetime2 columns (SQL Server)?": "http://stackoverflow.com/questions/19353294/how-do-i-calculate-interval-between-two-datetime2-columns-sql-server?rq=1",
     "Sql Server Cast & Convert DateTime and DateTime2 Fail Relentlessly": "http://stackoverflow.com/questions/28051066/sql-server-cast-convert-datetime-and-datetime2-fail-relentlessly?rq=1",
     "How to migrate datetime to datetime2 with new SQL Server Native Client": "http://stackoverflow.com/questions/31915308/how-to-migrate-datetime-to-datetime2-with-new-sql-server-native-client?rq=1",
     "SQL Server datetime2 in OPENQUERY": "http://stackoverflow.com/questions/32911493/sql-server-datetime2-in-openquery?rq=1",
     "Hot Network Questions": "http://stackexchange.com/questions?tab=hot",
     "Why doesn't the moon twinkle?": "http://astronomy.stackexchange.com/questions/14082/why-doesnt-the-moon-twinkle",
     "In simple English, what does it mean to be transcendental?": "http://math.stackexchange.com/questions/1686156/in-simple-english-what-does-it-mean-to-be-transcendental",
     "Why do objects appear smaller when viewed from a distance?": "http://physics.stackexchange.com/questions/242509/why-do-objects-appear-smaller-when-viewed-from-a-distance",
     "Is this a submatrix?": "http://codegolf.stackexchange.com/questions/75198/is-this-a-submatrix",
     "Where does the second door in Captain Janeway's 'Ready Room' lead?": "http://scifi.stackexchange.com/questions/121621/where-does-the-second-door-in-captain-janeways-ready-room-lead",
     "Asking logistics questions during an Interview?": "http://workplace.stackexchange.com/questions/63322/asking-logistics-questions-during-an-interview",
     "What does \"Honeykins\" mean?": "http://ell.stackexchange.com/questions/83991/what-does-honeykins-mean",
     "How can I determine a function equation from a graph image?": "http://engineering.stackexchange.com/questions/7855/how-can-i-determine-a-function-equation-from-a-graph-image",
     "Is it possible to spoil a child, but still teach them not to behave spoiled?": "http://parenting.stackexchange.com/questions/24287/is-it-possible-to-spoil-a-child-but-still-teach-them-not-to-behave-spoiled",
     "New colleague is a smoker; I can hardly breathe near him": "http://workplace.stackexchange.com/questions/63357/new-colleague-is-a-smoker-i-can-hardly-breathe-near-him",
     "How do I respond when a player trivially kills my boss monster?": "http://rpg.stackexchange.com/questions/76868/how-do-i-respond-when-a-player-trivially-kills-my-boss-monster",
     "Should I allow browsers to remember my passwords and synchronize them?": "http://security.stackexchange.com/questions/116881/should-i-allow-browsers-to-remember-my-passwords-and-synchronize-them",
     "How can SSL be on port 110?": "http://serverfault.com/questions/762570/how-can-ssl-be-on-port-110",
     "How much do we know about p-hacking \"in the wild\"?": "http://stats.stackexchange.com/questions/200745/how-much-do-we-know-about-p-hacking-in-the-wild",
     "If Rabbi Google quotes Mi Yodeya, can i rely on his advice?": "http://judaism.stackexchange.com/questions/69051/if-rabbi-google-quotes-mi-yodeya-can-i-rely-on-his-advice",
     "Why AUC =1 even classifier has misclassified half of the samples?": "http://stats.stackexchange.com/questions/200815/why-auc-1-even-classifier-has-misclassified-half-of-the-samples",
     "Type Lambda λ on a Mac?": "http://apple.stackexchange.com/questions/230422/type-lambda-%ce%bb-on-a-mac",
     "Inconsistent superscript placement in $q_x^{n_x} q_y^{n_y}$": "http://tex.stackexchange.com/questions/298290/inconsistent-superscript-placement-in-q-xn-x-q-yn-y",
     "Co-worker regularly placing his foot on my desk - how to get out of the situation?": "http://workplace.stackexchange.com/questions/63337/co-worker-regularly-placing-his-foot-on-my-desk-how-to-get-out-of-the-situatio",
     "Why did the original Game Boy have four colours?": "http://gaming.stackexchange.com/questions/258225/why-did-the-original-game-boy-have-four-colours",
     "Hack-resistant hosting solution for non-profit?": "http://security.stackexchange.com/questions/116877/hack-resistant-hosting-solution-for-non-profit",
     "How do the zombies win when they're so weak?": "http://worldbuilding.stackexchange.com/questions/37784/how-do-the-zombies-win-when-theyre-so-weak",
     "What to do if a colleague is reviewing an unchanged paper that has been rejected before on my recommendation?": "http://academia.stackexchange.com/questions/64782/what-to-do-if-a-colleague-is-reviewing-an-unchanged-paper-that-has-been-rejected",
     "How do I traverse an array diagonally in javascript": "http://stackoverflow.com/questions/35917734/how-do-i-traverse-an-array-diagonally-in-javascript",
     "question feed": "http://stackoverflow.com/feeds/question/1334143",
     "about us": "http://stackoverflow.com/company/about",
     "tour": "http://stackoverflow.com/tour",
     "blog": "http://blog.stackoverflow.com/?blb=1",
     "data": "http://data.stackexchange.com/",
     "legal": "http://stackexchange.com/legal",
     "privacy policy": "http://stackexchange.com/legal/privacy-policy",
     "work here": "http://stackoverflow.com/company/work-here",
     "advertising info": "http://stackexchange.com/mediakit",
     "mobile": "",
     "contact us": "http://stackoverflow.com/contact",
     "feedback": "http://meta.stackoverflow.com/",
     "Server Fault": "http://serverfault.com/",
     "Super User": "http://superuser.com/",
     "Web Applications": "http://webapps.stackexchange.com/",
     "Ask Ubuntu": "http://askubuntu.com/",
     "Webmasters": "http://webmasters.stackexchange.com/",
     "Game Development": "http://gamedev.stackexchange.com/",
     "TeX - LaTeX": "http://tex.stackexchange.com/",
     "Programmers": "http://programmers.stackexchange.com/",
     "Unix & Linux": "http://unix.stackexchange.com/",
     "Ask Different (Apple)": "http://apple.stackexchange.com/",
     "WordPress Development": "http://wordpress.stackexchange.com/",
     "Geographic Information Systems": "http://gis.stackexchange.com/",
     "Electrical Engineering": "http://electronics.stackexchange.com/",
     "Android Enthusiasts": "http://android.stackexchange.com/",
     "Information Security": "http://security.stackexchange.com/",
     "Database Administrators": "http://dba.stackexchange.com/",
     "Drupal Answers": "http://drupal.stackexchange.com/",
     "SharePoint": "http://sharepoint.stackexchange.com/",
     "User Experience": "http://ux.stackexchange.com/",
     "Mathematica": "http://mathematica.stackexchange.com/",
     "Salesforce": "http://salesforce.stackexchange.com/",
     "ExpressionEngine® Answers": "http://expressionengine.stackexchange.com/",
     "more (13)": "http://stackexchange.com/sites#technology",
     "Photography": "http://photo.stackexchange.com/",
     "Science Fiction & Fantasy": "http://scifi.stackexchange.com/",
     "Graphic Design": "http://graphicdesign.stackexchange.com/",
     "Movies & TV": "http://movies.stackexchange.com/",
     "Seasoned Advice (cooking)": "http://cooking.stackexchange.com/",
     "Home Improvement": "http://diy.stackexchange.com/",
     "Personal Finance & Money": "http://money.stackexchange.com/",
     "Academia": "http://academia.stackexchange.com/",
     "more (9)": "http://stackexchange.com/sites#lifearts",
     "English Language & Usage": "http://english.stackexchange.com/",
     "Skeptics": "http://skeptics.stackexchange.com/",
     "Mi Yodeya (Judaism)": "http://judaism.stackexchange.com/",
     "Travel": "http://travel.stackexchange.com/",
     "Christianity": "http://christianity.stackexchange.com/",
     "Arqade (gaming)": "http://gaming.stackexchange.com/",
     "Bicycles": "http://bicycles.stackexchange.com/",
     "Role-playing Games": "http://rpg.stackexchange.com/",
     "more (21)": "http://stackexchange.com/sites#culturerecreation",
     "Mathematics": "http://math.stackexchange.com/",
     "Cross Validated (stats)": "http://stats.stackexchange.com/",
     "Theoretical Computer Science": "http://cstheory.stackexchange.com/",
     "Physics": "http://physics.stackexchange.com/",
     "MathOverflow": "http://mathoverflow.net/",
     "Chemistry": "http://chemistry.stackexchange.com/",
     "Biology": "http://biology.stackexchange.com/",
     "more (5)": "http://stackexchange.com/sites#science",
     "Stack Apps": "http://stackapps.com/",
     "Meta Stack Exchange": "http://meta.stackexchange.com/",
     "Area 51": "http://area51.stackexchange.com/",
     "cc by-sa 3.0": "https://creativecommons.org/licenses/by-sa/3.0/",
     "attribution required": "http://blog.stackoverflow.com/2009/06/attribution-required/"
    };

Test runner

Ready to run.

Testing in
TestOps/sec
coercion
var item;
if (dict["Stack Overflow"]) {
  item = "foo1";
}

if (dict["does not exist"]) {
  item = "foo2";
}
ready
typeof
var item;
if (typeof dict["Stack Overflow"] !== 'undefined') {
  item = "foo3";
}

if (typeof dict["does not exist"] !== 'undefined') {
  item = "foo4";
}
ready
in
var item;
if ("Stack Overflow" in dict) {
  item = "foo5";
}

if ("does not exist" in dict) {
  item = "foo6";
}
ready
hasOwnProperty
var item;
if (dict.hasOwnProperty("Stack Overflow")) {
  item = "foo7";
}

if (dict.hasOwnProperty("does not exist")) {
  item = "foo8";
}
ready
undefined
var item;
if (dict["Stack Overflow"] !== undefined) {
  item = "foo9";
}

if (dict["does not exist"] !== undefined) {
  item = "foo10";
}
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.