목록분류 전체보기 (147)
게으른개발너D
React는 cross-site scripting 공격을 막기 위해서 html 태그가 담겨있는 string 형태를 렌더링하면, 태그로 나오지 않고 문자열 그대로 렌더링되게 한다. {svgArr?.map((grids: any[]) => grids.map((grid, i) => { return ( {grid} ); }) )} 여기서 svgArr은 svg 태그가 담겨져 있는 2차 배열이며, 이걸 화면에 나타내면 이렇게 나온다. 하.. 괴롭다 괴로워ㅠㅠㅠ 문자열을 html 형태로 렌더링하게되면 취약하지만 대비하고 있다! 라고 생각한다면, 해결하는 방법이 있다. dangerouslySetInnerHTML {svgArr?.map((grids: any[]) => grids.map((grid, i) => { retur..
https://leetcode.com/problems/check-if-object-instance-of-class/description/ Check if Object Instance of Class - LeetCode Can you solve this real interview question? Check if Object Instance of Class - Write a function that checks if a given value is an instance of a given class or superclass. For this problem, an object is considered an instance of a given class if that obj leetcode.com Write a..
https://leetcode.com/problems/join-two-arrays-by-id/description/ Join Two Arrays by ID - LeetCode Can you solve this real interview question? Join Two Arrays by ID - Given two arrays arr1 and arr2, return a new array joinedArray. All the objects in each of the two inputs arrays will contain an id field that has an integer value. joinedArray is an leetcode.com Given two arrays arr1 and arr2, retu..
https://leetcode.com/problems/flatten-deeply-nested-array/description/ Flatten Deeply Nested Array - LeetCode Can you solve this real interview question? Flatten Deeply Nested Array - Given a multi-dimensional array arr and a depth n, return a flattened version of that array. A multi-dimensional array is a recursive data structure that contains integers or leetcode.com Given a multi-dimensional ..
https://leetcode.com/problems/memoize/description/ Memoize - LeetCode Can you solve this real interview question? Memoize - Given a function fn, return a memoized version of that function. A memoized function is a function that will never be called twice with the same inputs. Instead it will return a cached value. You leetcode.com Given a function fn, return a memoized version of that function. ..
https://leetcode.com/problems/compact-object/description/ Compact Object - LeetCode Can you solve this real interview question? Compact Object - Given an object or array obj, return a compact object. A compact object is the same as the original object, except with keys containing falsy values removed. This operation applies to the objec leetcode.com Given an object or array obj, return a compact..
https://leetcode.com/problems/cache-with-time-limit/description/ Cache With Time Limit - LeetCode Can you solve this real interview question? Cache With Time Limit - Write a class that allows getting and setting key-value pairs, however a time until expiration is associated with each key. The class has three public methods: set(key, value, duration) leetcode.com Write a class that allows getting..
https://leetcode.com/problems/execute-asynchronous-functions-in-parallel/description/ Execute Asynchronous Functions in Parallel - LeetCode Can you solve this real interview question? Execute Asynchronous Functions in Parallel - Given an array of asynchronous functions functions, return a new promise promise. Each function in the array accepts no arguments and returns a promise. promise res leet..