casting in JS code example
Example 1: javascript casting objects
class Person {
constructor(obj) {
obj && Object.assign(this, obj);
}
getFullName() {
return `${this.lastName} ${this.firstName}`;
}
}
Example 2: casting in javascript
JavascriptExecutor js = (JavascriptExecutor) driver;
js.executeScript(Script,Arguments);