Keyword

Result: 65 questions

_________ is a JavaScript charting library and feature-rich API set that lets you build interactive Flash or HTML5 charts.

Quiz

What is Dart language?

Answer:

Dart is a general-purpose programming language originally developed by Google and later approved as a standard by Ecma (ECMA-408). It is used to build web, server and mobile applications, and for Internet of Things (IoT) devices. It is open-source software under a permissive free software license (modified BSD license).

Dart is an object-orientedclass definedsingle inheritance language using C# style syntax that transcompiles optionally into JavaScript. It supports interfacesmixinsabstract classesreified generics, and optional typing.

From Wikipedia

View

What is responsive design?

Answer:

Responsive design is about making websites work wherever the web is. Different devices with different sizes and different capabilities. Responsive design is about taking one code base and making it work for all of them. Part of that is media queries and different visuals. Part of that is different resources (e.g. different JavaScript to handle touch vs click or different images to accommodate the screen).

View

What are some of the key new features in HTML5?

Answer:

Key new features of HTML5 include:

  • Improved support for embedding graphics, audio, and video content via the new , , and  tags.

  • Extensions to the JavaScript API such as geolocation and drag-and-drop as well for storage and caching.

  • Introduction of “web workers”.

  • Several new semantic tags were also added to complement the structural logic of modern web applications. These include the 

    , , , , , , and  tags.

     

  • New form controls, such as , , , , , and .

View

What are “web workers”?

Answer:

Web workers at long last bring multi-threading to JavaScript.

A web worker is a script that runs in the background (i.e., in another thread) without the page needing to wait for it to complete. The user can continue to interact with the page while the web worker runs in the background. Workers utilize thread-like message passing to achieve parallelism.

View

How to enable JavaScript in WebView?

Quiz

Javascript is enabled by default in a WebView

Quiz

What is AngularJS?

Answer:

AngularJS is a javascript framework used for creating single web page applications.  It allows you to use HTML as your template language and enables you to extend HTML’s syntax to express your application’s components clearly

View

Explain what is Angular Expression? Explain what is key difference between angular expressions and JavaScript expressions?

Answer:

Like JavaScript,  Angular expressions are code snippets that are usually placed in binding such as {{ expression }}

The key difference between the JavaScript expressions and Angular expressions

  • Context : In Angular, the expressions are evaluated against a scope object, while the Javascript expressions are evaluated against the global window
  • Forgiving: In Angular expression evaluation is forgiving to null and undefined, while in Javascript undefined properties generates TypeError or ReferenceError
  • No Control Flow Statements: Loops, conditionals or exceptions cannot be used in an angular expression
  • Filters: To format data before displaying it you can use filters
View

Explain what Angular JS routes does ?

Answer:

Angular js routes enable you to create different URLs for different content in your application.  Different URLs for different content enables user to bookmark URLs to specific content.  Each such bookmarkable URL in AngularJS is called a route

A value in Angular JS is a simple object.  It can be a number, string or JavaScript object.  Values are typically used as configuration injected into factories, services or controllers. A value should be belong to an AngularJS module.

Injecting a value into an AngularJS controller function is done by adding a parameter with the same name as the value

View

Consider the following JavaScript code:

console.log("first");
setTimeout(function() {
    console.log("second");
}, 0);
console.log("third");

The output will be:

first
third
second

Assuming that this is the desired behavior, and that we are using Node.js version 0.10 or higher, how else might we write this code?

Answer:

Node.js version 0.10 introduced setImmediate, which is equivalent to setTimeout(fn, 0), but with some slight advantages.

setTimeout(fn, delay) calls the given callback fn after the given delay has ellapsed (in milliseconds). However, the callback is not executed immediately at this time, but added to the function queue so that it is executed as soon as possible, after all the currently executing and currently queued event handlers have completed. Setting the delay to 0 adds the callback to the queue immediately so that it is executed as soon as all currently-queued functions are finished.

setImmediate(fn) achieves the same effect, except that it doesn’t use the queue of functions. Instead, it checks the queue of I/O event handlers. If all I/O events in the current snapshot are processed, it executes the callback. It queues them immediately after the last I/O handler somewhat like process.nextTick. This is faster than setTimeout(fn, 0).

So, the above code can be written in Node as:

console.log("first");
setImmediate(function(){
    console.log("second");
});
console.log("third");
View

How does Node.js handle child threads?

Answer:

Node.js, in its essence, is a single thread process. It does not expose child threads and thread management methods to the developer. Technically, Node.js does spawn child threads for certain tasks such as asynchronous I/O, but these run behind the scenes and do not execute any application JavaScript code, nor block the main event loop.

If threading support is desired in a Node.js application, there are tools available to enable it, such as the ChildProcess module.

View

Consider following code snippet:

{
    console.time("loop");
    for (var i = 0; i < 1000000; i += 1){
        // Do nothing
    }
    console.timeEnd("loop");
}

The time required to run this code in Google Chrome is considerably more than the time required to run it in Node.js. Explain why this is so, even though both use the v8 JavaScript Engine.

Answer:

Within a web browser such as Chrome, declaring the variable i outside of any function’s scope makes it global and therefore binds it as a property of the window object. As a result, running this code in a web browser requires repeatedly resolving the property i within the heavily populated window namespace in each iteration of the for loop.

In Node.js, however, declaring any variable outside of any function’s scope binds it only to the module’s own scope (not the window object) which therefore makes it much easier and faster to resolve.

View

Inside which HTML element do we put the JavaScript?

Quiz

What is the correct JavaScript syntax to change the content of the HTML element below?

<p id="demo">This is a demonstration.</p>

Quiz

Where is the correct place to insert a JavaScript?

Quiz

The external JavaScript file must contain the <script> tag.

Quiz

How do you create a function in JavaScript?

Quiz

How to write an IF statement in JavaScript?

Quiz

How can you add a comment in a JavaScript?

Quiz

© 2017 QuizBucket.org