728x90
반응형

Front/JS & jQuery 438

[js] moment.js diff() 함수

moment.js 라이브러리에서는 두 날짜 또는 시간 간의 차이를 구할 때 diff() 함수를 사용합니다. 이 함수는 두 시간 간의 차이를 지정된 단위(예: milliseconds, seconds, minutes, hours, days, etc.)로 반환합니다. moment(date1).diff(moment(date2), unit, true); date1: 비교할 첫 번째 날짜/시간 (moment 객체 또는 날짜 문자열).date2: 비교할 두 번째 날짜/시간 (moment 객체 또는 날짜 문자열).unit: 차이를 구할 단위 (예: 'seconds', 'minutes', 'hours', 'days', 'months', 'years' 등). 이 매개변수는 선택 사항이며, 기본값은 'milliseconds..

Front/JS & jQuery 2024.08.12

[jquery] $.each 객체가 컬렉션으로 사용되는 경우

객체가 컬렉션으로 사용되는 경우 콜백에 키-값 쌍이 매번 전달됩니다.var obj = { "flammable": "inflammable", "duh": "no duh"};$.each( obj, function( key, value ) { alert( key + ": " + value );});  다시 말해서, 이는 두 가지 메시지를 생성합니다. https://api.jquery.com/jQuery.each/ jQuery.each() | jQuery API DocumentationDescription: A generic iterator function, which can be used to seamlessly iterate over both objects and arrays. Arrays and ar..

Front/JS & jQuery 2024.07.12

[js] { ...data } 와 data 대입의 차이

JavaScript에서 객체를 복사하는 방법에는 여러 가지가 있습니다.주어진 예제에서 let cvtData = { ...data };와 let cvtData = data;의 차이점은 다음과 같습니다:  Spread 문법을 사용한 객체 복사 ({ ...data }):복사 방식: Spread 문법을 사용하여 객체 data를 복사합니다.동작: 새로운 객체가 생성되며, data 객체의 속성들이 새로운 객체에 복사됩니다. 이 과정에서 깊은 복사(deep copy)가 이루어지지 않으며, 속성 값이 객체나 배열인 경우에는 참조 관계가 유지될 수 있습니다.let data = { foo: 'bar' };let cvtData = { ...data };  단순 대입을 통한 객체 참조 (data):복사 방식: 단순히 data..

Front/JS & jQuery 2024.07.11

[js][quill] quill editor 스페이스바 누르면 글머리 기호 설정되는 현상

https://imswengineer.tistory.com/770 [JS][Quill] quill editor - 자동 글머리기호 완성 비활성화 하기https://stackoverflow.com/questions/43008547/how-to-disable-automatic-bullets-in-quill How to disable automatic bullets in Quill Just started using Quill and find it very useful. My projects require plain text editing. Specifically I'm using quill as a forimswengineer.tistory.com keyboard: { bindings: { ..

Front/JS & jQuery 2024.06.23
728x90
반응형