Sort Score
Result 10 results
Languages All
Labels All
Results 121 - 130 of 16,346 for

test

(0.14 sec)
  1. var vs let vs const | InterviewBit

    var vs let vs const - In javascript, you can create/declare variables using keywords var, let, and const. Let’s see the differences between these keywords to have a better understanding of what to use and where. Scope Scope essentially means where these variables are available for use. There are two types of scopes in JS: * Function Scope: Visibility is limited to the function. function myFn() { var x = 10; console.log(x); //prints 10 } console.log(x); // ReferenceError: x is not defined * Block Scope: Visibility is limited to the block of code. if (true) { let x = 10; console.log(x); //prints 10 } console.log(x); // ReferenceError: x is not defined Now, that we have idea of scope. We can discuss the scope of var, let and const. * var declarations are function scoped. * let declarations are block scoped. * const declarations are block scoped. Redefining and Redeclaring feature A variable declared using ‘var’ can be redefined and even redeclared anywhere throughout its scope. var x = 30; console.log(x); //prints 30 x = "Hi"; //redefining or re-assigning (works without any error) console.log(x); //prints "Hi" var y = 10; console.log(y); //prints 10 var y = "Hello"; //Redeclaring (works without any error) console.log(y) //Prints "Hello" A variable declared using ‘let’ can be redefined within its scope but cannot be re-declared within its scope. let x = 11; console.log(x); //prints 11 x = "IB"; //works without any error console.log(x); //prints "IB" let y = 12; console.log(y); //prints 12 let y = "Scaler"; // error: Identifier y has already been declared let z = 13; if(true){ let z = "Fun"; //works without any error as scope is different. console.log(z) //prints "Fun" } console.log(z) //prints 13 A variable declared using ‘const’ cannot be redefined or re-declared within its scope. const x = 10; console.log(x); //prints 10 x = 11; // error: Assignment to constant variable. const y; y = 2; //error const z = 12; console.log(z) //prints 12 const z= 13; // error: Identifier 'y' has already been declared Every const declaration must be initialized at the time of declaration. Hoisting Hoisting is a mechanism where variables and function declarations are moved to the top of their scope before code execution. console.log(x); // prints undefined var x = 100; console.log(x); //prints 100 * Variables declared using var are hoisted to the top of their scope and initialized with a value of undefined(special type). * Variables declared using let are hoisted to the top of their scope but are not initialized with any value. * Variables declared using const are hoisted to the top of their scope but are not initialized with any value. console.log(x); // prints undefined var x = 100; console.log(x); //prints 100 console.log(y); //Reference error let y = 200; console.log(y); //prints 200 console.log(z); //Reference error const z = 300; console.log(z); //prints 300 Try the following example in the editor below. Predict the output of the following code: var a = 10; { var a = -10; } let b = a; { let b = -20; } console.log(b)...OTP Skip By clicking on Start Test, I agree to be contacted by...Instructions from Interviewbit Start Test...

    www.interviewbit.com/problems/var-vs-let-vs-const/
  2. GitHub - aspose-html-cloud/aspose-html-cloud-py...

    Python library for communicating with the Aspose.HTML Cloud API - aspose-html-cloud/aspose-html-cloud-python...doc doc html_doc html_doc test test testdata testdata .gitignore...setup.py setup.py test-requirements.txt test-requirements.txt...

    github.com/aspose-html-cloud/aspose-html-cloud-...
  3. Class Inheritance | InterviewBit

    Class Inheritance - Inheritance The process by which one class acquires the properties(data members) and functionalities(methods) of another class is called inheritance. The aim of inheritance is to provide the reusability of code so that a class has to write only the unique features and rest of the common properties and functionalities can be extended from the another class. Class inheritance is a way for one class to extend another class. So we can create new functionality on top of the existing. Child Class The class that extends the features of another class is known as child class, sub class or derived class. Parent Class The class whose properties and functionalities are used(inherited) by another class is known as parent class, super class or Base class. A real life example of inheritance can between Vehicle and Car class where each car inherits the properties and functionalities of a vehicle. Hence, Car acts as a subclass of Vehicle. Similarly Truck and Bus are also subclasses of super class Vehicle. image ( https://ibb.co/2P7RM8f ) Now, lets look at the code given below: class X { constructor(a, b) { this.a = a; this.b = b; } printHi() { console.log("Hi"); } } class Y extends X { //Y is a subclass of X constructor(a, b, c) { super(a, b); //refers to the constructor of parent class X this.c = c; //c is exclusive to Class Y only. } printHello() { //printHello is exclusive to class Y only. console.log("Hello"); } } const x1 = new X(1, 2); //x1 contains properties: a, b, printHi console.log(x1.a); console.log(x1.b); console.log(x1.printHi()); const y1 = new Y("a", "b", "c"); //y1 contains properties: a, b, printHi, c, printHello console.log(y1.a); console.log(y1.b); console.log(y1.c); console.log(y1.printHi()); console.log(y1.printHello()); In the above code, class Y “extends” class X, which means class Y is a subclass of superclass X. All the properties of X (a, b and printHi) also exist in class Y. Also, class Y contains some extra properties that are specific to it only (c and printHello). super is a special keyword which refers to the constructor function of the parent class. Try the following example in the editor below. Given a class A having properties x and y. Declare a class B which inherits class A and has properties z and printIB (prints “IB”(without quotes) to the console when called). Also, the constructor of class B should set the values of x, y and z to the values provided in the user input. Sample If input: 1 2 3 is provided in the console then values of properties x, y and z properties should be set to 1, 2 and 3 respectively....OTP Skip By clicking on Start Test, I agree to be contacted by...Instructions from Interviewbit Start Test...

    www.interviewbit.com/problems/class-inheritance/
  4. 300+ Must Do Coding Questions from Interviews |...

    Ace your next coding interview by practicing our hand-picked coding interview questions. Conquer the fear of coding interview and land your dream job!...OTP Skip By clicking on Start Test, I agree to be contacted by...Instructions from Interviewbit Start Test...

    www.interviewbit.com/coding-interview-questions/
  5. Recursion | InterviewBit

    Recursion - Recursion is the process of repeating items in a self-similar way. In programming languages, if a program allows you to call a function inside the same function, then it is called a recursive call of the function. Lets see an example of recursive code in JavaScript. function recurse() { // function code recurse(); // function code } recurse(); Here, the recurse() function is a recursive function. It is calling itself inside the function. image ( https://s3.ap-south-1.amazonaws.com/myinterviewtrainer-domestic/public_assets/assets/000/000/252/original/image.png?1616401337 ) While using recursion, one need to be careful to define an exit condition from the function, otherwise it will go into an infinite loop. function fun() { if(condition) { fun(); } else { // stop calling fun() //code return; } } fun(); Recursive functions are very useful to solve many mathematical problems. Try the following example in the editor below. Given an input number A, find Ath fibonacci number. fib0 = 0 fib1 = 1 fibi = fibi-2 + fibi-1 (i > 1) Sample Input 3 Sample Output 2...OTP Skip By clicking on Start Test, I agree to be contacted by...Instructions from Interviewbit Start Test...

    www.interviewbit.com/problems/recursion/
  6. While downloading the file with table count of ...

    while downloading the file with table count of rows 344 and columns of count 44 shows the error called System.OutOfMemoryException using aspose pdf table... We will test the scenario and will guide...

    forum.aspose.cloud/t/while-downloading-the-file...
  7. Aspose.Cells Cloud 20.1 Release Notes

    Aspose.Cells Cloud 20.1 Release Notes – the laTest updates and fixes. Aspose.Cells Cloud supports Excel to create, convert, merge, split, protected, inner object operation, and so on....Feature CELLSCLOUD-10275 Update test case about color filter and...

    releases.aspose.cloud/cells/release-notes/2020/...
  8. Regular vs Arrow Functions | InterviewBit

    Regular vs Arrow Functions - We can create Javascript functions in many ways. function hello() { console.log("Hello world"); } const hi = function hi() { console.log("Hi world"); } const bye = function() { //using anonymous function console.log("Bye world"); } The above three methods of declaration are refered as regular function declaration. The only difference in the above declarations is in the stack trace that appears when there is an error. Arrow functions were introduced in ES6. Arrow functions allow us to write shorter function syntax. const hello = () => { console.log("Hello world"); } If the function has only one statement, and the statement returns a value, we can remove the brackets and the return keyword. For e.g. Regular Function function helloName(name) { return "Hello " + name; } Arrow function const helloName = (name) => "Hello " + name; So, Arrow functions lets us write functions even in a single line! If we have one parameter, we can even omit the parentheses that enclose the parameter const helloName = name => "Hello " + name; Both arrow functions and regular functions can be used as object methods. Now, lets see where the differences emerge between the different function declaring and defining methods. 1) this binding * Regular functions have their own dynamic this binding, while arrow functions do not have their own this. The value of this inside a regular function depends on how the function is invoked. During a simple invocation the value of this equals to the global object (or undefined if the function runs in strict mode) function fun() { console.log(this); } fun(); // prints global object (window) During a method invocation the value of this is the object owning the method: const obj = { fun() { console.log(this); } }; obj.fun(); // prints obj * The value of this inside an arrow function remains the same throughout the lifecycle of the function and is always bound to the value of this in the closest non-arrow parent function. In the following example, fun1() is an outer regular function of fun2() arrow function: const obj = { fun1(items) { console.log(this); // prints obj const fun2 = () => { console.log(this); // prints obj }; } }; this value inside the arrow function fun2() equals to this value of the outer function fun1(). 2) arguments object * Inside the body of a regular function, arguments is a special array-like object containing the list of arguments with which the function has been invoked. function fun() { console.log(arguments); } myFunction('a', 'b'); // prints { 0: 'a', 1: 'b'} * No arguments object is defined inside an arrow function. The arguments object is resolved lexically: the arrow function accesses arguments from the closest outer non-arrow function. function fun1() { const fun2 = () => { console.log(arguments); } fun2('c', 'd'); } fun1('a', 'b'); // prints { 0: 'a', 1: 'b' } 3) new keyword * Regular functions created using function declarations or expressions are constructible (means that we can use regular functions as constructors) and callable. And since regular functions are constructible, they can be called using the new keyword. function fun(){ console.log("hello"); } const obj = new fun(); //valid code * The arrow functions are only callable and not constructible, i.e arrow functions can never be used as constructor functions. Hence, they can never be called with the new keyword. let fun = () => { console.log("hello); } const obj = new fun(): // Gives error Find the output for the given code below. let obj = { a: 100, fun1() { let a = 20; let fun2 = () => { console.log(this.a); } fun2(); } } obj.fun1();...OTP Skip By clicking on Start Test, I agree to be contacted by...Instructions from Interviewbit Start Test...

    www.interviewbit.com/problems/regular-vs-arrow-...
  9. GitHub - aspose-words-cloud/aspose-words-cloud-...

    Contribute to aspose-words-cloud/aspose-words-cloud-dart development by creating an account on GitHub....examples_data lib lib test test test_data test_data .gitignore .gitignore...pubspec_package_testing.yaml pubspec_package_testing.yaml View all...

    github.com/aspose-words-cloud/aspose-words-clou...
  10. Blogger: User Profile: Techaholic

    Blogger is a blog publishing tool from Google for easily sharing your thoughts with the world. Blogger makes it simple to post text, photos and video onto your personal or team blog....Rajesh Singh Tech Tips & Tricks Test Mk Appar Samy Silks ApparSwamySilks...

    www.blogger.com/profile/13929897508496358342