Google News
logo
UI Developer Interview Questions
* Tags are used when linking to an image. The image has to be specified in quotes using the source attribute, src in the opening tag <>.
 
* An anchor tag is used when linking to a website, and <href> attribute is used to specify the website link.
 
* The anchor tag has the text to be hyperlinked, and if you are linking to an email address, the <href> specification will be “mailto:example@domain.com”.
While designing or developing for multilingual sites, below things should be followed :
 
* The default language should be set, using unicode encoding

* We should use the ‘lang’ attribute and should be aware of standard font sizes and text direction

* language word length should be taken into account as it may affect layout.
We can use Javascript "find" method for the same :
let customers = [
  { id: 0, name: 'free' },
  { id: 1, name: 'time' },
  { id: 2, name: 'learn' }
];
let customer = customers.find(cust => cust.name === 'learn');
console.log(customer);
--> { id: 2, name: 'learn' } 
While creating a complicated front-end application with tons of non-code static possessions, for instance, CSS, fonts, images, etc, then, of course, you should make use of Webpack since it has a lot of amazing benefits.
 
If you have a small application that doesn't have a lot of static resources and you only have to create one file of JavaScript to help the customers, then Webpack should be more overhead than needed.
IN a JSON method, stringify is used to transform a JavaScript object into a string. JSON is a common structure to receive and send data between the web server and the client, and when we wish to send data to the webserver, the object ought to be a string.
var data={ID:1, first_name:"Ramana", second_name:"Reddy"};
var send_data=JSON.stringify(data);​
Progressive rendering is a process that is utilized generally to boost the web page's rendering content process. Now the rendering process is utilized in modern web development to enhance the mobile data uses of the user, async HTML fragments, prioritizing visible content, and lazy loading of images.
We can do that using the “filter” function :
let data = [
  "files/dir1/file1",
  "files/dir1/file2",
  "files/dir2/file1",
  "files/dir2/file2"
];
let filteredData = data.filter(path => path.includes('dir2'));
console.log(filteredData);
--> [ 'files/dir2/file1', 'files/dir2/file2' ]​
Generally, the function name is defined when we define the function itself, in normal user-defined functions, but in the case of an anonymous function, the function name is not defined. Here we make use of an assignment operator and variable to stow the function as an object, then utilizing that variable, we will be capable to invoke the function itself.
 
Example :
var add = function(a,b){consol.log(a+b)}
add(4,5);   //9
The most important difference between class-based and prototype-based inheritance is that a class defines a type that can be instantiated at runtime. On the other hand, a prototype is itself an object instance. In JavaScript, the object system is prototype-based, not class-based. That's why inheritance in JavaScript is different from other programming languages.
 
Objects are just a collection of name and value pairs in JavaScript. In JavaScript inheritance, there is only one construct, called object. Every object has private property linked to another object known as its prototype.
Many people think that Null and Undefined are the same in JavaScript, but they have many differences. In the following table, we have included the key differences between them :

Null Undefined
A null is an object with no value. Undefined is a type.
Null is an intentional absence of the value. It is one of the primitive values of JavaScript. In Undefined, the value does not exist in the compiler. It is the global object.
typeof null; // "object" typeof undefined; // "undefined"
Null is equal to undefined but not identical.
null == undefined // true
null === undefined // false
A variable is defined as null when trying to convey that the variable is empty. A variable is defined as undefined when we try to convey that the variable does not exist or is not available.
Null is also referred to as false.
Example :
null ? console.log("true") : console.log("false") //
false
When a variable is not assigned a value, it is called Undefined.
Example :
var temp;
if(temp === undefined)
console.log("true");
else
console.log("false");