본문 바로가기

분류 전체보기

(54)
(36/60) Refer to the code below: Which value can a developer expect when referencing country,capital,cityString? let country = { get capital() { let city = Number("London"); return { cityString: city.toString(), } } } console.log(country); console.log(country.capital); console.log(country.cityString); https://onecompiler.com/javascript/3ynjmmjp8 3ynjmmjp8 - JavaScript - OneCompiler Javascript Online Compiler Write, Run & Share Javascript code online using OneCompiler's JS online compiler for free. It's one..
(35/60) A class was written to represent items for purchase in an online store, and a second classRepresenting items that are on sale at a discounted price. THe constructor sets the name to thefirst value passed in. The pseudocode is below:Class Item {c.. class Item { constructor(name, price) { //... // Constructor Implementation this.name = name; this.price = price; } } class SaleItem extends Item { constructor(name, price, discount) { super(name, price); this.discount = discount; //...//Constructor Implementation } } let regItem =new Item('Scarf', 55); let saleItem = new SaleItem('Shirt', 80, -1); Item.prototype.description = function () { retu..
(34/60) Which option is true about the strict mode in imported modules? Answer 'A' ==> automatically in strict mode, with no statement needed to initiate it Answer is A. Source: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import import - JavaScript | MDN The static import declaration is used to import read-only live bindings which are exported by another module. The imported bindings are called live bindings because they are updated ..
(33/60) Given the following code: is the output of line 02? let x = null console.log(typeof x); https://onecompiler.com/javascript/3ynjjz94w 3ynjjz94w - JavaScript - OneCompiler Javascript Online Compiler Write, Run & Share Javascript code online using OneCompiler's JS online compiler for free. It's one of the robust, feature-rich online compilers for Javascript language. Getting started with the OneCompiler's Javascript editor is onecompiler.com
(32/60) Refer to the following code that performs a basic mathematical operation on a providedinput:function calculate(num) {Return (num +10) / 3;}How should line 02 be written to ensure that x evaluates to 6 in the line below?Let x = calculate (8); 파라메터로 받은 num 변수를 우선적으로 Number(num) 으로 씌워주는 것이 답이다. function calculate(num) { //return (num + 10) / 3; //return Number( (num +10) / 3 ); return (Number(num) + 10) / 3; } let x = calculate(8); console.log(x); https://onecompiler.com/javascript/3ynjjedmp 3ynjjedmp - JavaScript - OneCompiler Javascript Online Compiler Write, Run & Share Javascript code online using OneCompiler's JS online compiler f..
(31/60) Which three actions can be using the JavaScript browser console?Choose 3 answers:
(30/60) Which two console logs output NaN? Choose 2 answers. console.log(parseInt("two")) ; console.log(10 / 0); console.log(10 / 'five'); console.log(10 / Number(5) ) ; // parseInt 기능 확인해보기 console.log(parseInt(`2`)) ; https://onecompiler.com/javascript/3ynjhwybm 3ynjhwybm - JavaScript - OneCompiler Javascript Online Compiler Write, Run & Share Javascript code online using OneCompiler's JS online compiler for free. It's one of the robust, feature-rich on..
(21/60) Refer to the code snippet below:Let array = [1, 2, 3, 4, 4, 5, 4, 4];For (let i =0; i < array.length; i++){if (array[i] === 4) {array.splice(i, 1);}}What is the value of the array after the code executes? let array = [1, 2, 3, 4, 4, 5, 4, 4]; for (let i=0; i < array.length; i++){ if (array[i] === 4) { console.log(i); array.splice(i, 1); console.log(array); } } console.log(array); https://mine-it-record.tistory.com/352 [JavaScript] arr.splice() - 배열 데이터 추가/제거/교체/추출 하기 Array.prototype.splice() 메서드는 배열의 기존 요소를 삭제 또는 교체하거나 새 요소를 추가하여 배열의 내용을 변경한다. 한마디로 splice() 메서드를 가지고 push/pop/unshift/shift 역할을 다 할..