Ambiera Forum

Discussions, Help and Support.

Create a new account, Search, or Login:
Name: Password:
Ambiera Forum > CopperCube > Programming and Scripting
Classes in CCB-JavaScript?
Author Text

AGBdev
Guest
Quote
2022-04-11 16:44:30

Is it possible to define Classes in JavaScript when using CopperCube?

Everytime i try to define a class i get the Syntax-Error "missing ; before statement".

Or maybe Im just defining classes wrong idk.

class Test {
stuff() {

}
}



AGBdev
Guest
Quote
2022-04-11 17:00:48

Ok nevermind ES5 just found out doesnt support classes lol.


AGBdev
Guest
Quote
2022-04-11 17:02:38

AGBdev wrote:
Ok nevermind ES5 just found out doesnt support classes lol.


*Ok nevermind just found out that JavaScript ES5 doesnt support classes lol.


guest
Guest
Quote
2022-04-27 02:32:17

can use function as class !

function myFunc(parameters) {
// etc etc
};

var myVar = new myFunc(parameters);

my var now separate instance of myfunc


Arcanjo
Guest
Quote
2022-04-27 21:28:41

AGBdev, you don't use Class in CC's JavaScript.


DouweDabbe
Guest
Quote
2022-05-24 04:55:17

Tip:

3 ways to define a JavaScript class
September 29th, 2006. Tagged: JavaScript
My Tag: Coppercube
https://www.phpied.com/3-ways-to-define-a-javascript-class/

function Apple (type) {
this.type = type;
this.color = "red";
}

Apple.prototype.getInfo = function() {
print("this color="+ this.color + '"\n type=" + this.type );
};


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "I?ternational" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© 2020 Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact