Is Prototype.js still needed with ES2021 or can I simply define a class?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-14-2023 03:39 AM
Hey community!
I was wondering if I still need to use the old Script Include pattern for class creation. This is currently inserted by the ServiceNow instance when I create a new Script Include:
var MyScriptInclude = Class.create();
MyScriptInclude.prototype = {
initialize: function() {
},
type: 'MyScriptInclude'
};
Now, I would like to know if I can replace this with the following code and still expect it to work as it should when my scoped application is set to ECMA2021:
class MyScriptInclude {
contructor() {
}
myOwnMethod() {
}
}
Tobias
0 REPLIES 0