컨텐츠로 건너뛰기

Dev Diary

검색
  • Home
  • Profile
  • Contact

날짜별 글 목록: 2023년 11월 03일

Front-end

이미지 포맷 판별 방법

2023년 11월 03일 Quasar 댓글 남기기

Javascript 에서 url 또는 path 로 표현된 파일을 인자로 받았을 때 이미지인지 아닌지 확인

// use Regexp 
function isImage( fileName ) {
   const regexp = /(\.jpg|\.jpeg|\.png)$/i;
   return regexp.text( fileName );
}

console.log( isImage( 'test.png' ) ); // true
console.log( isImage( 'test.txt' ) ); // false

javascript

meta

  • 로그인
  • 입력 내용 피드
  • 댓글 피드
  • WordPress.org

SUPERQUASAR

  • How to implement gun shooting sound playback in three.js
  • [KR]How to improve my swimming
  • How to improve my swimming
  • SaaSpocalypse and the Illusion of Zero UI
  • Copyrights Free useful art sharing sites
2023 11월
일 월 화 수 목 금 토
 1234
567891011
12131415161718
19202122232425
2627282930  
« 10월   1월 »
로그인

최신 글

  • How to implement gun shooting sound playback in three.js
  • [KR]How to improve my swimming
  • How to improve my swimming
  • SaaSpocalypse and the Illusion of Zero UI
  • Copyrights Free useful art sharing sites
  • AI Posting
  • Art
  • Back-end
  • Diary
  • Front-end
  • Graphics
  • Language
  • Mathematics
  • Miscellaneous
  • Music
  • Photo
  • Physics
  • Project
  • ProjectManagement
  • Scrape
  • Stock
  • Swimming
  • Travel
  • Unity3D
  • UnrealEngine4
  • 미분류
Proudly powered by WordPress