9
bitjedi
6y

Javascript Sucks !!!! Perfect Example of Karma is cyclic dependency in javascript.

Comments
  • 2
    Hello
  • 0
    Elaborate please
  • 1
    @Froot there was a cyclic dependency in my code and it took me hour to figure out... Because of that data becomes empty "{}"
  • 3
    I'm about... 100% sure this is a you problem and not a javascript problem.
  • 1
    @D--M sure its mine but Java makes me more careful by sensible errors. which javascript doesn't.. Although javascript is one of the highly robust language and cool as well.. but at error side it gives me some problem.
  • 2
    I also think it sucks, it lets you do a lot a stupid stuff.
    A lot of the es6 features feel like a hack made with duct tape to hide how much js sucks.
  • 1
    Use typescript
  • 1
    @bitjedi Ah right I think I see what your problem was. I think what you meant is a reference not a dependency. Objects in JS are stored as references so if you assign an object to a new variable it's actually the same object in both variables. Change one and the other changes too. I agree, it sucks, I'd much more prefer if everything was immutable but if you take care how you write you're code it's alright.
Add Comment