symbol_unique() in Javascript?
Does the Javascript API expose symbol_unique() anywhere?
I'm looking but not finding it.
The issue is that I'm calling new JitterObject() for a jit.gl.text3d, and the returned object doesn't have a name component (myObj.name appears to be ""). I can programmatically set the name, but if I re-instantiate the Javascript the name is no longer unique and ob3d complains. Hence the need for something like symbol_unique().
Is something unclear about the question or is everybody just too busy with other stuff?
Hi Peter,
as far as i know there is no such object/method in JavaScript.
A posible solution that comes to my mind would be to use the actual timestamp as part of the name-string. When using micro seconds that should be able to create a unique string.
Or you could create a JavaScript object in the global scope that carries an incremental index. Add this index to a string an raise it by 1 each time you instantiate your object.
Best jan.
Thanks, Jan!
Appending Date.now() works fine for my purposes.
It does seem strange that jit.gl.text3d objects don't automatically get a unique string when they're instantiated in Javascript.
Yes indeed it is strange that is doesn't - especially other objects like jit.matrix do expose their automatically created names. Sounds like a bug for me...