frontend-challenges icon indicating copy to clipboard operation
frontend-challenges copied to clipboard

FrontendChallenges is a collection of frontend interview questions and answers. It is designed to help you prepare for frontend interviews. It's free and open source.

Results 109 frontend-challenges issues
Sort by recently updated
recently updated
newest added

index.js ```js index.js function User(name, birthday) { this.name = name; this.birthday = birthday; Object.defineProperty(this, "age", { get: function () { let todayYear = new Date().getFullYear(); return todayYear - this.birthday.getFullYear(); },...

answer
javascript
117

index.js ```js index.js let group = { title: "Our Group", students: ["John", "Pete", "Alice"], showList() { this.students.forEach((student) => { console.log(this.title + ': ' + student); }); } }; export {...

answer
javascript
115

index.js ```js index.js let group = { title: "Our Group", students: ["John", "Pete", "Alice"], showList() { const that = this; this.students.forEach(function(student) { console.log(that.title + ': ' + student); }); }...

answer
javascript
115

index.js ```js index.js export function promiseAll(promises) { return new Promise((resolve, reject) => { let results = []; let completedPromises = 0; if (promises.length === 0) { resolve([]); return; } promises.forEach((promise,...

answer
javascript
35

index.js ```js index.js export function spyOn(obj, methodName) { const originalMethod = obj[methodName]; const spy = { calls: [], results: [], restore: function () { obj[methodName] = originalMethod; }, }; obj[methodName]...

answer
javascript
109

This is an auto-generated PR that auto reflect on #106, please go to #106 for discussion or making changes. Closes #106

new-challenge
auto-generated
106

## Info ```yaml difficulty: easy title: Fix the vertical alignment type: question template: vanilla tags: css ``` ## Question We have a row layout where there can be inputs with...

question
vanilla
new-challenge

index.js ```js index.js export function createFunctions() { const functions = []; let i = 0; while(i < 10) { let j = i; let func = function () { console.log(j);...

answer
javascript
99

index.js ```js index.js export function createFunctions() { const functions = []; for (let i = 0; i < 10; i++) { let func = function () { console.log(i); }; functions.push(func);...

answer
javascript
99

index.js ```js index.js class Queue { constructor() { this.items = []; } enqueue(element) { this.items.push(element); } dequeue() { return this.items.shift(); } front() { return this.items[0]; } isEmpty() { return this.size()...

answer
javascript
95