Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Feb 2005
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Smile Operator Precedence

    1st i need to prioritise operators. How do i do that?

    highiest ------------------------------lowest priority

    ^ *,/ +,- <,>,=... & (and) |(or)
    Last edited by liorean; 03-10-2005 at 02:26 PM. Reason: Given a more meaningful title

  • #2
    Master Coder
    Join Date
    Feb 2003
    Location
    UmeŚ, Sweden
    Posts
    5,575
    Thanks
    0
    Thanked 83 Times in 74 Posts
    Highest to lowest priority. All in the same category have the same priority and are evaluated on a left-to-right basis.
    Code:
    Category                Operators                    
    ----                    ----
    Member                  .
                            []
    
    Call                    ()
                            new
    
    Unary                   !
                            ~
                            -
                            +
                            ++
                            --
                            typeof
                            void
                            delete
    
    Multiplicative          *
                            /
                            %
    
    
    Additive                +
                            -
    
    Bitwise shift           <<
                            >>
                            >>>
    
    Relational              <
                            <=
                            >
                            >=
                            in
                            instanceof
    
    Equality                ==
                            ===
                            !=
                            !==
    
    Bitwise AND             &
    
    Bitwise XOR             ^
    
    Bitwise OR              |
    
    Logical AND             &&
    
    Logical OR              ||
    
    Conditional             ?:
    
    Assignment              =
                            +=
                            -=
                            *=
                            /=
                            %=
                            <<=
                            >>=
                            >>>=
                            &=
                            ^=
                            |=
    
    Sequential              ,
    liorean <[lio@wg]>
    Articles: RegEx evolt wsabstract , Named Arguments
    Useful Threads: JavaScript Docs & Refs, FAQ - HTML & CSS Docs, FAQ - XML Doc & Refs
    Moz: JavaScript DOM Interfaces MSDN: JScript DHTML KDE: KJS KHTML Opera: Standards


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •