Announcement

Collapse
No announcement yet.

I have a question about object literal functions

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • I have a question about object literal functions

    When writing functions, is it best to stick with using object literal function when writing functions? The reason I ask, is because I was watching a video from Udemy that stated Object Constructors and anonymous functions can slow the browser down, and can be harder to write than object literals.

    I'm new to JavaScript, and would like some insight in which functions I should stick with. Thank you for any help.

  • #2
    Originally posted by pacheco316 View Post
    would like some insight in which functions I should stick with.
    www.w3schools.com/js/js_functions.asp

    In JavaScript, you can use functions the same way as you use variables.

    Comment


    • #3
      It's really a matter of personal taste. Any decrease in speed would be unnoticeable in modern browsers. Do what you're most comfortable with.
      Jon Hanlon

      Comment

      Working...
      X