Gijs Posted October 23, 2016 Share Posted October 23, 2016 Hi, while making a 3D modeller, I found that the Curve3 class has a function named "continue", which seems to be a reserved word. Apparently it hasn't broken anything thus far, so is it fine, or should it be deprecated / renamed to "concat"? Quote Link to comment Share on other sites More sharing options...
jerome Posted October 23, 2016 Share Posted October 23, 2016 mmmh... in our case continue() is just a method of a Curve3 instance, so something like that : curve1.continue(curve2); This has nothing to do with the js statement : continue; Quote Link to comment Share on other sites More sharing options...
Gijs Posted October 23, 2016 Author Share Posted October 23, 2016 2 hours ago, jerome said: mmmh... in our case continue() is just a method of a Curve3 instance, so something like that : curve1.continue(curve2); This is nothing to do with the js statement : continue; I know, but the page I linked lists it as reserved, and says "In JavaScript, some identifiers are reserved words and cannot be used as variables or function names." Quote Link to comment Share on other sites More sharing options...
adam Posted October 23, 2016 Share Posted October 23, 2016 I'm pretty sure you need to be looking at the section where they list reserved words for objects, properties, and methods. Quote Link to comment Share on other sites More sharing options...
jerome Posted October 23, 2016 Share Posted October 23, 2016 JavaScript Objects, Properties, and Methods You should also avoid using the name of JavaScript built-in objects, properties, and methods: Array Date eval function hasOwnProperty Infinity isFinite isNaN isPrototypeOf length Math NaN name Number Object prototype String toString undefined valueOf Quote Link to comment Share on other sites More sharing options...
fenomas Posted October 23, 2016 Share Posted October 23, 2016 Reserved words in JS are only illegal to use as identifiers for local vars and functions. Object properties can be named pretty much anything. myobj.for = 1 myobj.var = 2 myobj.new = 3 myobj.break = 4 myobj.continue = 5 All perfectly fine. Even the words in Jerome's post are legal variable names - it's just suggesting they be avoided for clarity's sake. Long story short, nothing at all to worry about here. jerome, GameMonetize and Gijs 3 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.