Sep 27, 2020

Learn Protractor & Jasmine Framework for End to End Testing | Chapter 6 | Functions & Objects in JavaScript

1. Creating methods & functions inside a function in JavaScript

2. Use of it in Protractor
3. Create a constructor function and invoke function via object.
4. Export object globally and use it in other files in project.

Demo Website: 

File 1: Functions.js

function account()

    //method inside function

    this.getAccountNumber = function(){


// var obj = new account();
// obj.getAccountNumber();
// console.log(obj.ssn);
// console.log(;

module.exports = new account();
File 2: Functions2.js (To invoke objects and methods from above file)
var obj = require("./Functions");

No comments:

Post a Comment

Thanks a lot for your valuable Comment!

Featured this week

Latest Employment BUZZ: 4 working days in a week?

COVID-19 has hit mostly all sectors including IT  too bad. If we think otherwise, on the other hand,  there have been many new technical inn...