JavaScript-Developer-I 試験問題 11
オンラインストアで購入できるアイテムを表すクラスが作成され、2番目のクラスは
割引価格で販売されている商品を表します。コンストラクタは名前を
最初に渡された値。擬似コードは以下のとおりです。
クラスアイテム {
コンストラクター(名前、価格) {
... // コンストラクタの実装
}
}
クラス SaleItem は Item を継承します {
コンストラクタ(名前、価格、割引){
...//コンストラクタの実装
}
}
開発者には、次の内容を返す説明メソッドを実装するという新しい要件があります。
商品および販売商品の簡単な説明。
Let regItem =new Item('Scarf', 55);
let saleItem = new SaleItem('Shirt' 80, -1);
Item.prototype.description = function () { return 'これは' + this.name;
console.log(regItem.description());
console.log(saleItem.description());
SaleItem.prototype.description = function () { return 'これは割引された ' +
this.name; }
console.log(regItem.description());
console.log(saleItem.description());
上記のコードを実行したときの出力は何ですか?
割引価格で販売されている商品を表します。コンストラクタは名前を
最初に渡された値。擬似コードは以下のとおりです。
クラスアイテム {
コンストラクター(名前、価格) {
... // コンストラクタの実装
}
}
クラス SaleItem は Item を継承します {
コンストラクタ(名前、価格、割引){
...//コンストラクタの実装
}
}
開発者には、次の内容を返す説明メソッドを実装するという新しい要件があります。
商品および販売商品の簡単な説明。
Let regItem =new Item('Scarf', 55);
let saleItem = new SaleItem('Shirt' 80, -1);
Item.prototype.description = function () { return 'これは' + this.name;
console.log(regItem.description());
console.log(saleItem.description());
SaleItem.prototype.description = function () { return 'これは割引された ' +
this.name; }
console.log(regItem.description());
console.log(saleItem.description());
上記のコードを実行したときの出力は何ですか?
JavaScript-Developer-I 試験問題 12
Refer to the code below:
01 const addBy = ?
02 const addByEight = addBy(8);
03 const sum = addByEight(50);
1行目を置き換えて合計値に58を返すことができる関数はどれですか?(2つ選択)
01 const addBy = ?
02 const addByEight = addBy(8);
03 const sum = addByEight(50);
1行目を置き換えて合計値に58を返すことができる関数はどれですか?(2つ選択)
JavaScript-Developer-I 試験問題 13
以下のコードが与えられた場合:
x = ('15' + 10) + 2 とする。
xの値は何ですか?
x = ('15' + 10) + 2 とする。
xの値は何ですか?
JavaScript-Developer-I 試験問題 14
以下のコードを参照してください。

myfunction(true)が呼び出されたとき、何が表示されますか?

myfunction(true)が呼び出されたとき、何が表示されますか?
JavaScript-Developer-I 試験問題 15
A developer has the following array of student test grades:
Let arr = [ 7, 8, 5, 8, 9 ];
The Teacher wants to double each score and then see an array of the students
who scored more than 15 points.
How should the developer implement the request?
Let arr = [ 7, 8, 5, 8, 9 ];
The Teacher wants to double each score and then see an array of the students
who scored more than 15 points.
How should the developer implement the request?
