diff options
author | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:42:17 -0500 |
---|---|---|
committer | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:42:17 -0500 |
commit | da78a9e329e272dedb2400b79a3bdeebff387d47 (patch) | |
tree | e6ef8aa7c43556f55ddfe031a01cf0a8fa271bfe /files/ko/web/api/storage/length | |
parent | 1109132f09d75da9a28b649c7677bb6ce07c40c0 (diff) | |
download | translated-content-da78a9e329e272dedb2400b79a3bdeebff387d47.tar.gz translated-content-da78a9e329e272dedb2400b79a3bdeebff387d47.tar.bz2 translated-content-da78a9e329e272dedb2400b79a3bdeebff387d47.zip |
initial commit
Diffstat (limited to 'files/ko/web/api/storage/length')
-rw-r--r-- | files/ko/web/api/storage/length/index.html | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/files/ko/web/api/storage/length/index.html b/files/ko/web/api/storage/length/index.html new file mode 100644 index 0000000000..53b092b939 --- /dev/null +++ b/files/ko/web/api/storage/length/index.html @@ -0,0 +1,68 @@ +--- +title: Storage.length +slug: Web/API/Storage/length +tags: + - API + - Property + - Read-only + - Reference + - Storage + - Web Storage +translation_of: Web/API/Storage/length +--- +<div>{{APIRef("Web Storage API")}}</div> + +<p>{{domxref("Storage")}} 인터페이스의 <code>length</code> 읽기 전용 속성은 <code>Storage</code> 객체에 저장된 데이터 항목의 수를 반환합니다.</p> + +<h2 id="구문">구문</h2> + +<pre class="syntaxbox notranslate"><em>length</em> = <em>storage</em>.length;</pre> + +<h3 id="반환_값">반환 값</h3> + +<p><code>Storage</code> 객체에 저장된 항목의 수.</p> + +<h2 id="예제">예제</h2> + +<p>다음의 함수는 현재 도메인의 로컬 저장소에 세 개의 항목을 추가한 후 저장소 항목의 수를 반환합니다.</p> + +<pre class="brush: js notranslate">function populateStorage() { + localStorage.setItem('bgcolor', 'yellow'); + localStorage.setItem('font', 'Helvetica'); + localStorage.setItem('image', 'cats.png'); + + return localStorage.length; // Should return 3 +}</pre> + +<div class="note"> +<p><strong>참고</strong>: 실제 사용 예제를 보시려면 저희의 <a href="https://mdn.github.io/dom-examples/web-storage/">Web Storage Demo</a>를 방문하세요.</p> +</div> + +<h2 id="명세">명세</h2> + +<table class="standard-table"> + <tbody> + <tr> + <th scope="col">Specification</th> + <th scope="col">Status</th> + <th scope="col">Comment</th> + </tr> + <tr> + <td>{{SpecName('HTML WHATWG', 'webstorage.html#dom-storage-length', 'Storage.length')}}</td> + <td>{{Spec2('HTML WHATWG')}}</td> + <td></td> + </tr> + </tbody> +</table> + +<h2 id="브라우저_호환성">브라우저 호환성</h2> + + + +<p>{{Compat("api.Storage.length")}}</p> + +<h2 id="같이_보기">같이 보기</h2> + +<ul> + <li><a href="/ko/docs/Web/API/Web_Storage_API/Using_the_Web_Storage_API">Web Storage API 사용하기</a></li> +</ul> |