One Paragraph of project description goes here
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
import { prettifyFloat, prettifyNumbers } from "./number" | |
import { describe, expect, test } from "@jest/globals" | |
describe("prettifyFloat Function Util Test", () => { | |
test("0.01 & demical point 1 to Equal '0.01'", () => { | |
expect(prettifyFloat(0.01)).toBe("0.01") | |
}) | |
test("1.0001 & demical point 1 to Equal '1.0'", () => { |
const targetObj = { | |
id:1, | |
name: 'seunghyun' | |
} | |
// 1 | |
const obj = JSON.parse(JSON.stringfy(targetObj)) | |
// 2 | |
function structuralClone(obj) { |
import React, { useEffect, useState, useRef } from 'react'; | |
import useWhenVisible from './useWhenVisible'; | |
const TodoList = () => { | |
const limit = 25; | |
const [offset, setOffset] = useState(0); | |
const [todos, setTodos] = useState([]); | |
const lastEl = useRef(); | |
useEffect(() => { |
const convertToArray = number => [...`number`].map(el => parseInt(el)) | |
convertToArray(5678) // [5,6,7,8] |
{"lastUpload":"2021-05-09T05:47:26.497Z","extensionVersion":"v3.4.3"} |
> db.news.find({"byline":{"$ne":[]}, "provider_code":"02100501"}).explain() | |
{ | |
"queryPlanner" : { | |
"plannerVersion" : 1, | |
"namespace" : "newstrust.news", | |
"indexFilterSet" : false, | |
"parsedQuery" : { | |
"$and" : [ | |
{ | |
"provider_code" : { |
> db.news.find({"byline":{"$ne":[]}, "provider_code":"02100501"}).explain() | |
{ | |
"queryPlanner" : { | |
"plannerVersion" : 1, | |
"namespace" : "newstrust.news", | |
"indexFilterSet" : false, | |
"parsedQuery" : { | |
"$and" : [ | |
{ | |
"provider_code" : { |
findReports: function(req, res) { | |
Report.find() | |
.populateAll() | |
.then((reports) => { | |
return Promise.all(reports.map((report) => { | |
if (report.post) { | |
var reportUser = report.post.user | |
} else { | |
var reportUser = report.comment.user | |
} |
def index | |
flash[:danger] = "다른 사람이 이미 가져갔습니다." | |
end |