Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8613927
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T04:59:49+00:00 2026-06-12T04:59:49+00:00

In this test , I am looking at two different ways of function expressions;

  • 0

In this test, I am looking at two different ways of function expressions; using the exclamation point unary operator and using brackets.

The following are the 2 tests:

var f = !function() {};

var f = (function() {});

Given the results below, I was intrigued when I saw that the unary operator test was ~5261% faster than the brackets test in Firefox.

enter image description here

enter image description here

What sort of optimization is going on that amounts to such a significant increase in performance in Firefox, dwarfing the other browsers?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T04:59:50+00:00Added an answer on June 12, 2026 at 4:59 am

    The first one is resulting in a boolean, and the second one a function. There doesn’t seem to be much real-world significance to your test.

    “What sort of optimization is going on that amounts to such a significant increase in performance in Firefox, dwarfing the other browsers?”

    I suppose Firefox has an optimization that avoids creation of the function object since it is never actually used, but that’s just a guess.


    Here’s an updated jsPerf. This one adds two tests that create boolean values. Notice that they’re very close to the “Exclamation” test in Firefox.

    This lends support to the idea that Firefox has this particular optimization.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following test, with two almost identical blocks. Now i am looking
I found this orientation test code below looking for JQTouch reference material. This works
I'm new to NUnit and looking for an explination as to why this test
Work on this small test application to learn threading/locking. I have the following code,
We're looking to iron out issues in our different dev/test/prod environments. Currently we have
I have tried all kinds of different ways to query this but just can't
In this test Core Data project, I have a one to many relationship from
On this test page: http:// www.onebagoneearth.com/ Products-test , where it says oboe love series,
I have this test slider http://jsfiddle.net/dUyLY/2/ In Chrome it works nice, but in firefox
Why doesn't this test case work? <?php // cards with cyrillic inidices and suits

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.