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