Задача - это одна из кат на codewars, туплю с решением.
Создать экземпляр объекта, не вызывая оператор new:
// Implement the functionality of the 'new' operator as if you had the code:
// var myObj = new MyObject();
// but do not use the 'new' operator.
//
// Start with a simple empty Object literal.
var myObj = {};
Тесты для проверки правильности ответа:
describe('',function(){
it('Create a new MyObject', function(){
Test.expect(myObj instanceof MyObject, 'myObj must be an instance of MyObject');
Test.expect(myObj.myOwnProperty, 'myObj must be built with the MyObject constructor');
Test.expect(!myObj.hasOwnProperty('myPrototypeMethod'), 'myObj must use the MyObject prototype');
Test.expect(myObj.myPrototypeMethod()==true, 'myObj must share the MyObject prototype functions');
});
});