Keyword

Result: 65 questions

What is the correct way to write a JavaScript array?

Quiz

What is the correct JavaScript syntax for opening a new window called "w2" ?

Quiz

JavaScript is the same as Java.

Quiz

How do you declare a JavaScript variable?

Quiz

Is JavaScript case-sensitive?

Quiz

What is JSON? How would convert JSON data into Python data?

Answer:

JSON – stands for JavaScript Object Notation. It is a popular data format for storing data in NoSQL
databases. Generally JSON is built on 2 structures.
1. A collection of <name, value> pairs.
2. An ordered list of values.
As Python supports JSON parsers, JSON-based data is actually represented as a dictionary in Python. You can convert json data into python using load() of json module.

View

How node.js works?

Answer:

Node.js works on a v8 environment, it is a virtual machine that utilizes JavaScript as its scripting language and achieves high output via non-blocking I/O and single threaded event loop.

View

Why node.js is quickly gaining attention from JAVA programmers?

Answer:

Node.js is quickly gaining attention as it is a loop based server for JavaScript. Node.js gives user the ability to write the JavaScript on the server, which has access to things like HTTP stack, file I/O, TCP and databases.

View

What are the pros and cons of Node.js?

Answer:

Pros:

a) If your application does not have any CPU intensive computation, you can build it in Javascript top to bottom, even down to the database level if you use JSON storage object DB like MongoDB.

b) Crawlers receive a full-rendered HTML response, which is far more SEO friendly rather than a single page application or a websockets app run on top of Node.js.

Cons:

a) Any intensive CPU computation will block node.js responsiveness, so a threaded platform is a better approach.
b) Using relational database with Node.js is considered less favourable

View

What is the difference between Node.js vs Ajax?

Answer:

The difference between Node.js and Ajax is that, Ajax (short for Asynchronous Javascript and XML) is a client side technology, often used for updating the contents of the page without refreshing it. While,Node.js is Server Side Javascript, used for developing server software. Node.js does not execute in the browser but by the server.

View

What does it mean “non-blocking” in node.js?

Answer:

In node.js “non-blocking” means that its IO is non-blocking.  Node uses “libuv” to handle its IO in a platform-agnostic way. On windows, it uses completion ports for unix it uses epoll or kqueue etc. So, it makes a non-blocking request and upon a request, it queues it within the event loop which call the JavaScript ‘callback’ on the main JavaScript thread.

View

What is REPL in context of Node?

Answer:

REPL stands for Read Eval Print Loop and it represents a computer environment like a window console or unix/linux shell where a command is entered and system responds with an output. Node.js or Node comes bundled with a REPL environment. It performs the following desired tasks.

  • Read - Reads user's input, parse the input into JavaScript data-structure and stores in memory.

  • Eval - Takes and evaluates the data structure

  • Print - Prints the result

  • Loop - Loops the above command until user press ctrl-c twice.

View

Which of the expressions listed below will result in "false"?

true    ? "true" : "false"
false   ? "true" : "false"
nil     ? "true" : "false"
1       ? "true" : "false"
0       ? "true" : "false"
"false" ? "true" : "false"
""      ? "true" : "false"
[]      ? "true" : "false"

Answer:

In Ruby, the only values that evaluate to false are false and nilEverything else – even zero (0) and an empty array ([]) – evaluates to true.

This comes as a real surprise to programmers who have previously been working in other languages like JavaScript.

(Thanks to Ruby Gotchas for this question.)

View

What is XML Parser?

Answer:

XML Parser is used to convert from XML document into an XML DOM object which can be written in Javascript.

View

Which of the following is a true statement for JavaScript callbacks?

Quiz

Which of the following is the output of the below JavaScript code?

function getFunc() {
    var a = 7;
    return function(b) {
        alert(a+b);
    }
}
var f = getFunc();
f(5);
Quiz

When executed, the below JavaScript code will pop up three alerts. Identify the corret answer?

var a = 6;
function test() {
    var a = 7;
    function again() {
        var a = 8;
        alert(a);  // A
    }
    again();
    alert(a);  // B
}
test();
​alert(a);​  // C
Quiz

Which of the following is the output of the below JavaScript code?

function() {
    if(true) {
        var a = 5;
    }
    alert(a);
}
Quiz

Which of the following is the output of the below JavaScript code?

  var x = [typeof x, typeof y][1];
  typeof typeof x;
Quiz

What is the output of the following JavaScript snippet?

function() {
    var a = 10;
    if(a > 5) {
        a = 7;
    }
    alert(a);
}
Quiz

© 2017 QuizBucket.org