Know what promises are in Javascript Flashcards

1
Q

Know what promises are in Javascript

A

Promises in JavaScript are objects that represent the eventual completion or failure of an asynchronous operation and its resulting value.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the Default font size in a website

A

16px

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is a function in Javascript

A

In JavaScript, a function is a block of code designed to perform a particular task and is executed when “called” or “invoked”.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are Javascript Built-ins and what are some examples?

A

JavaScript built-ins are functions and objects that are built into the JavaScript language and do not require any external libraries. Examples include Math, Date, and Array.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Describe a runtime error

A

A runtime error is an error that occurs when a program is running and can cause the program to crash or behave unexpectedly.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How would you display video game 2D graphics without plug-ins?

A

2D graphics can be displayed without plugins using HTML5 Canvas or SVG.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How do you vertically align an image?

A

To vertically align an image, set the display property of the parent element to “flex” and then use the “align-items” property with a value of “center”.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is a FIPPA and what does it do?

A

FIPPA stands for Freedom of Information and Protection of Privacy Act, which is a Canadian law that regulates the collection, use, and disclosure of personal information by public bodies.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What can you do to make sure a website will display correctly on Mobile Devices?

A

To ensure a website displays correctly on mobile devices, use responsive design techniques such as using media queries and flexible layouts.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Describe a Grid-based layout.

A

A grid-based layout is a design approach that uses a grid system to organize content on a webpage.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What’s the code to link an external CSS to HTML5?

A

To link an external CSS to HTML, use the <link></link> tag with the “href” attribute set to the path of the CSS file.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How do you embed JavaScript into a HTML5 document?

A

To embed JavaScript into an HTML5 document, use the

 tag with the "src" attribute set to the path of the JavaScript file or include the JavaScript code directly within the 
 tags.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Know what a valid assignment expression in JavaScript looks like.

A

A valid assignment expression in JavaScript looks like “variable = value”.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

How do you show calculation result of several field in a form?

A

To show calculation results of several fields in a form, write a JavaScript function that calculates the values and displays the result in another field.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

How would you add whitespace between each item in form?

A

To add whitespace between each item in a form, use the CSS “margin” property with a value of the desired amount of whitespace.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Know what a CSS declaration looks like.

A

A CSS declaration consists of a property and a value separated by a colon, and is enclosed in curly braces. For example: “color: red;”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

Know the differences between a method and a function

A

In JavaScript, a method is a function that is associated with an object, while a function is a standalone block of code that can be called from anywhere in the program.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

What is the role of Javascript objects in Javascript

A

JavaScript objects are used to store and manipulate data, and can be used to represent real-world objects or concepts.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

Describe the Javascript confirm() method.

A

The JavaScript confirm() method displays a dialog box with a message and OK/Cancel buttons, and returns true if the user clicks OK and false if the user clicks Cancel.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

How do you ensure cross-browser compatibility?

A

To ensure cross-browser compatibility, use web standards and write code that is compatible with multiple browsers, test the website on different browsers, and use polyfills or fallbacks for features that are not supported in some browsers.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

What HTML5 attribute checks to see if a text area is empty when the form is submitted?

A

The HTML5 “required” attribute checks to see if a text area is empty when the form is submitted.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

What HTML structural element would you place advertisements?

A

Advertisements can be placed within the <aside> element in HTML.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

What HTML structural element would you place a company logo?

A

A company logo can be placed within the <header> element in HTML.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

What is Text-overflow?

A

Text-overflow is a CSS property that specifies how to handle text that overflows the boundaries of its container element.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Q

What the difference between an alert and a prompt?

A

An alert displays a dialog box with a message and an OK button, while a prompt displays a dialog box with a message, a text input field, and OK/Cancel buttons, and returns the value entered in the input field.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
26
Q

In relation to a computer programming, scripting, or markup language, a “bug “is an error in the code. Which type of bug will not cause error alert?

A

A syntax error is a type of bug that results from incorrect code syntax and can cause error alerts.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
27
Q

What are round buttons in a group of predetermined choices called?

A

Round buttons in a group of predetermined choices are called radio buttons.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
28
Q

Know what the difference between null vs undefined.

A

null is a value that represents the intentional absence of any object value, while undefined is a value that represents an uninitialized or non-existent variable.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
29
Q

What happens when you specify the value cover to the background-size property?

A

When you specify the value “cover” to the background-size property, the background image is scaled to cover the entire element while maintaining its aspect ratio.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
30
Q

Web designer were forced to format their pages using only fonts that were installed (or likely to be installed) on users computers. With css3, you can now specify an font you want, even custom fonts, using?

A

Custom fonts can be specified using the @font-face rule in CSS3.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
31
Q

What happens when you specify the value contained in the background-size property?

A

When you specify the value “contained” in the background-size property, the background image is scaled to fit within the element while maintaining its aspect ratio.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
32
Q

How do you code two images for a background?

A

Two images for a background can be coded using the CSS “background-image” property with multiple URLs separated by commas.

33
Q

What protocol would you use to create a link in your mobile site that will allow a smartphone user to send a text message?

A

The “sms:” protocol can be used to create a link in a mobile site that allows a smartphone user to send a text message.

34
Q

What function does the CSS3 background -clip property perform?

A

The CSS3 background-clip property determines the area of an element where the background image is displayed.

35
Q

When you use the CSS3 opacity property, how do you specify the level or transparency to apply?

A

To specify the level of transparency to apply with the CSS3 opacity property, set the value to a decimal between 0 (fully transparent) and 1 (fully opaque).

36
Q

What happens when you assign a negative z-index value to an element? A positive z-index value?

A

Assigning a negative z-index value to an element places it behind other elements in the stacking order, while a positive z-index value places it in front of other elements.

37
Q

When you want to create an overlay, how can you specify the stack order of an element?

A

To specify the stack order of an overlay, use the CSS “z-index” property with a higher value than the elements below it.

38
Q

Why would you use the CSS3 opacity property when you overlap images or other element in your webpage?

A

used to control the transparency of an element, including images, text, or other HTML elements.

39
Q

The outline property draw a line around the outside an element beyond the border. What can you use to create space between the border and the outline of an element?

A

To create space between the border and the outline of an element, you can use the “outline-offset” property in CSS.

40
Q

What JavaScript What JavaScript method should you use if you want to write a message the the user in your web page as the page load tin the browser?

A

If you want to write a message to the user as the page loads in the browser, you can use the “window.alert()” method in JavaScript.

41
Q

Why should you test your JavaScript code in multiple browser?

A

You should test your JavaScript code in multiple browsers to ensure that it works consistently across different platforms and devices.

42
Q

What does the JavaScript prompt() method do?

A

The JavaScript prompt() method displays a dialog box that prompts the user for input.

43
Q

What are the three way to create an array in Javascript

A

There are three ways to create an array in JavaScript: using the array constructor, using the array literal notation, or using the Array.from() method.

44
Q

What are the various attributes of an object, such as height, color font size, length, etc?

A

Attributes of an object refer to the properties that define the object, such as its height, color, font size, length, etc.

45
Q

In Javascript, what are action of an object?

A

Actions of an object refer to the methods that can be performed on the object, such as changing its properties or triggering events.

46
Q

What is the purpose of DOM?

A

The purpose of the Document Object Model (DOM) is to provide a structured representation of an HTML or XML document, which can be manipulated using scripting languages like JavaScript.

47
Q

Many of the new HTML5 element and attributes are semantic, which means…?

A

Many of the new HTML5 elements and attributes are semantic, which means that they provide more meaningful information about the content of a Web page.

48
Q

When is copyright granted to you? when can you sue?

A

Copyright is granted to you automatically when you create an original work, but you can only sue for infringement if you have registered your copyright with the relevant authorities.

49
Q

YOu are reviewing the style sheet code written by a colleague and notice several rules that are enclosed between the /* and */ characters. What will happen when you link the stylesheet to the web document?

A

When you link a stylesheet to a Web document, any rules enclosed between the /* and */ characters will be ignored by the browser, as they are treated as comments.

50
Q

Know the difference between a style guide and style sheet.

A

A style guide is a set of guidelines for designing consistent and effective user interfaces, while a style sheet is a document that defines the styles for a Web page or site.

51
Q

Know how inline CSS affect external CSS.

A

Inline CSS overrides any external or internal CSS rules for a given element.

52
Q

Why would you use the CSS3 border-radius property in your Web document?

A

The CSS3 border-radius property is used to create rounded corners on elements.

53
Q

What CSS3 property is used to specify transparency for an element?

A

The CSS3 property used to specify transparency for an element is “opacity”.

54
Q

For DOM manipulation, what language is used?

A

For DOM manipulation, JavaScript is the language used.

55
Q

How do you embed Javascript into HTML?

A

To embed JavaScript into HTML, you can use the

 tag in the <head> or <body> sections.
56
Q

In a fieldset, how would you add white space between items?

A

To add whitespace between items in a fieldset, you can use the “margin” property in CSS.

57
Q

What language is used for DOM manipulation?

A

JavaScript is the language used for DOM manipulation.

58
Q

Know how to write code for a CSS declaration.

A

A CSS declaration consists of a property and a value, separated by a colon and terminated with a semicolon.

59
Q

Know how to align a flex item horizontally.

A

To align a flex item horizontally, you can use the “justify-content” property in CSS.

60
Q

How would you ensure cross-browser compatibility?

A

To ensure cross-browser compatibility, you should test your code in multiple browsers and use vendor prefixes where necessary.

61
Q

How can a style be applied to an element in a single page, but not every occurrence on the page?

A

To apply a style to an element in a single page, but not every occurrence on the page, you can use a unique ID or class for the specific element.

62
Q

WHat should you use to display 2D video graphics on webpage without the use of plugins?

A

To display 2D video graphics on a Web page without the use of plugins, you can use the HTML5 canvas element.

63
Q

Why should you test an HTML5 form in a variety of browsers?

A

You should test an HTML5 form in a variety of browsers to ensure that it works consistently across different platforms and devices.

64
Q

Describe the resize property

A

The “resize” property in CSS is used to control whether an element can be resized by the user.

65
Q

Why is it important to use style guides when designing website and documents?

A

Style guides are important when designing Websites and documents because they help to ensure consistency and coherence across different pages and sections.

66
Q

How can you make images fit the available space in a mobile screen?

A

To make images fit the available space in a mobile screen, you can use the “max-width” property in CSS.

67
Q

When do runtime errors occur?

A

Runtime errors occur when a program is running and encounters an unexpected condition or situation.

68
Q

What is the correct ode to define audio in HTML5?

A

The correct code to define audio in HTML5 is <audio></audio>.

69
Q

How do you add multiple background to a webpage?

A

To add multiple backgrounds to a Web page, you can use the “background-image” property in CSS, separated by commas.

70
Q

Write a code that would ensure hat a visitor to your website is over 18 before granting access to webpage?

A

To ensure that a visitor to your website is over 18 before granting access to a Web page, you can use JavaScript to prompt for age verification and conditionally display the page based on the user’s response.

71
Q

What is the difference between a method and a function in Javascript? how do you correctly embed external CSS in a webpage?

A

The difference between a method and a function in JavaScript is that a method is a function that is associated with an object, while a function is a standalone block of code that can be called from anywhere in the program.

72
Q

What is the <legend> element used for?

A

To create a search input field that only accepts input in characters and numbers, you can use the “pattern” attribute in HTML5, with a regular expression that matches only alphanumeric characters.

73
Q

How do you create a search input filed that only accept input in characters and numbers?

A

The HTML5 attributes for the <input></input> element include type, name, value, placeholder, required, pattern, min, max, and step.

74
Q

What code can you check a filed for being less than a certain length?

A

To correctly embed external CSS in a Web page, you should use the <link></link> tag in the <head> section of the HTML document.

75
Q

What are the value HTML5 attributes for the input <input></input> element?

A

The <legend> element in HTML is used to provide a caption or title for a fieldset.

76
Q

You want to make sure your company’s website displays well on mobile devices, what tool should you use to test this?

A

To test your company’s website for mobile compatibility, you can use tools like Google’s Mobile-Friendly Test or BrowserStack.

77
Q

What function can be used to add elements to DOM?

A

The function used to add elements to the DOM is “appendChild()”.

78
Q

What is the best way to perform repeated functionalities to minimize quality issues in the current and future versions?

A

The best way to perform repeated functionalities in a way that minimizes quality issues is to use modular and reusable code, and to follow established coding standards and best practices.