๐Ÿค” NaN์ด ๋ญ˜๊นŒ?

์œค์ˆ˜์ธยท2024๋…„ 9์›” 16์ผ
0

๐Ÿ—‚๏ธ ์˜ค๋ฅ˜ / ์ •๋ฆฌ

๋ชฉ๋ก ๋ณด๊ธฐ
17/19
post-thumbnail

Javascript์—์„œ ์ˆซ์ž ์—ฐ์‚ฐ์„ ์‹œ๋„ํ•  ๋•Œ, undefined or null์ด๋ผ์„œ ๋‚˜ํƒ€๋‚œ๋‹ค.

NaN = Not a Number
: ๋ฐ์ดํ„ฐ๊ฐ€ ์ž˜๋ชป๋œ ์ƒํƒœ๋กœ ์ˆซ์ž๋กœ ๋ณ€ํ™˜๋  ๋•Œ



๐Ÿซจ ๊ตฌํ˜„ํ•˜๊ณ ์ž ํ•˜๋Š” ๊ฒƒ

index๋กœ ๋‚ด๊ฐ€ ์›ํ•˜๊ณ ์ž ํ•˜๋Š” ์…€์„ ์ฐพ์•„์„œ ์—†์œผ๋ฉด "" ์ด๊ฒŒ ํ–ˆ์ง€๋งŒ, ์—ฌ๊ธฐ์„œ ๋ฌธ์ œ๊ฐ€ ์ƒ๊ฒผ๋‚˜๋ณด๋‹ค,,

cell.getValue()๊ฐ€ undefined or null or ๋ฐ์ดํ„ฐ ์ž์ฒด๊ฐ€ ๋น„์–ด์žˆ์–ด์„œ ๋ฐœ์ƒํ•  ์ˆ˜ ์žˆ๋‹ค๊ณ  ํ•œ๋‹ค ,,,!!



๐Ÿ˜† ๊ตฌํ˜„ํ•œ ๊ฒƒ

<tbody>
    {visitTable.getRowModel().rows.map((row,rowIndex) => (
      <RowTr key={row.id}>
		{row.getVisibleCells().map((cell,cellIndex) => (
      <MainStatsCell key={cell.id}>
		{rowIndex === visitTable.getRowModel().rows.length-1 && cellIndex === 0 
      ? "": String(cell.getValue())}
      </MainStatsCell>
  		))}
    </RowTr>
  ))}
    </tbody>
profile
์–ด์ œ๋ณด๋‹ค ์กฐ๊ธˆ ๋” ์„ฑ์žฅํ•˜๊ธฐ!

0๊ฐœ์˜ ๋Œ“๊ธ€