\href{https://semaphoreci.com/medikoo-org/es6-symbol}{\texttt{ }} \href{https://ci.appveyor.com/project/medikoo/es6-symbol}{\texttt{ }}  \href{https://www.npmjs.com/package/es6-symbol}{\texttt{ }}\hypertarget{md_sfcode_node_modules_es6_symbol_README_autotoc_md9181}{}\doxysection{es6-\/symbol}\label{md_sfcode_node_modules_es6_symbol_README_autotoc_md9181}
\hypertarget{md_sfcode_node_modules_es6_symbol_README_autotoc_md9182}{}\doxysubsection{ECMAScript 6 Symbol polyfill}\label{md_sfcode_node_modules_es6_symbol_README_autotoc_md9182}
For more information about symbols see following links


\begin{DoxyItemize}
\item \href{http://www.2ality.com/2014/12/es6-symbols.html}{\texttt{ Symbols in ECMAScript 6 by Axel Rauschmayer}}
\item \href{https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol}{\texttt{ MDN Documentation}}
\item \href{https://tc39.github.io/ecma262/\#sec-symbol-objects}{\texttt{ Specification}}
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_es6_symbol_README_autotoc_md9183}{}\doxysubsubsection{Limitations}\label{md_sfcode_node_modules_es6_symbol_README_autotoc_md9183}
Underneath it uses real string property names which can easily be retrieved, however accidental collision with other property names is unlikely.\hypertarget{md_sfcode_node_modules_es6_symbol_README_autotoc_md9184}{}\doxysubsubsection{Usage}\label{md_sfcode_node_modules_es6_symbol_README_autotoc_md9184}
If you\textquotesingle{}d like to use native version when it exists and fallback to \href{https://ponyfill.com}{\texttt{ ponyfill}} if it doesn\textquotesingle{}t, use {\itshape es6-\/symbol} as following\+:


\begin{DoxyCode}{0}
\DoxyCodeLine{var Symbol = require("{}es6-\/symbol"{}); }

\end{DoxyCode}


If you want to make sure your environment implements {\ttfamily Symbol} globally, do\+:


\begin{DoxyCode}{0}
\DoxyCodeLine{require("{}es6-\/symbol/implement"{}); }

\end{DoxyCode}


If you strictly want to use polyfill even if native {\ttfamily Symbol} exists (hard to find a good reason for that), do\+:


\begin{DoxyCode}{0}
\DoxyCodeLine{var Symbol = require("{}es6-\/symbol/polyfill"{}); }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_es6_symbol_README_autotoc_md9185}{}\doxyparagraph{API}\label{md_sfcode_node_modules_es6_symbol_README_autotoc_md9185}
Best is to refer to \href{https://tc39.github.io/ecma262/\#sec-symbol-objects}{\texttt{ specification}}. Still if you want quick look, follow examples\+:


\begin{DoxyCode}{0}
\DoxyCodeLine{var Symbol = require("{}es6-\/symbol"{});}
\DoxyCodeLine{}
\DoxyCodeLine{var symbol = Symbol("{}My custom symbol"{});}
\DoxyCodeLine{var x = \{\};}
\DoxyCodeLine{}
\DoxyCodeLine{x[symbol] = "{}foo"{};}
\DoxyCodeLine{console.log(x[symbol]);}
\DoxyCodeLine{("{}foo"{});}
\DoxyCodeLine{}
\DoxyCodeLine{// Detect iterable:}
\DoxyCodeLine{var iterator, result;}
\DoxyCodeLine{if (possiblyIterable[Symbol.iterator]) \{}
\DoxyCodeLine{  iterator = possiblyIterable[Symbol.iterator]();}
\DoxyCodeLine{  result = iterator.next();}
\DoxyCodeLine{  while (!result.done) \{}
\DoxyCodeLine{    console.log(result.value);}
\DoxyCodeLine{    result = iterator.next();}
\DoxyCodeLine{  \}}
\DoxyCodeLine{\} }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_es6_symbol_README_autotoc_md9186}{}\doxysubsubsection{Installation}\label{md_sfcode_node_modules_es6_symbol_README_autotoc_md9186}
\hypertarget{md_sfcode_node_modules_es6_symbol_README_autotoc_md9187}{}\doxyparagraph{NPM}\label{md_sfcode_node_modules_es6_symbol_README_autotoc_md9187}
In your project path\+: \begin{DoxyVerb}$ npm install es6-symbol
\end{DoxyVerb}
 \label{md_sfcode_node_modules_es6_symbol_README_autotoc_md9188}%
\Hypertarget{md_sfcode_node_modules_es6_symbol_README_autotoc_md9188}%
\doxysubparagraph*{Browser}

To port it to Browser or any other (non CJS) environment, use your favorite CJS bundler. No favorite yet? Try\+: \href{http://browserify.org/}{\texttt{ Browserify}}, \href{https://github.com/medikoo/modules-webmake}{\texttt{ Webmake}} or \href{http://webpack.github.io/}{\texttt{ Webpack}}\hypertarget{md_sfcode_node_modules_es6_symbol_README_autotoc_md9189}{}\doxysubsection{Tests}\label{md_sfcode_node_modules_es6_symbol_README_autotoc_md9189}
\begin{DoxyVerb}$ npm test
\end{DoxyVerb}
 \hypertarget{md_sfcode_node_modules_es6_symbol_README_autotoc_md9190}{}\doxysubsection{Security contact information}\label{md_sfcode_node_modules_es6_symbol_README_autotoc_md9190}
To report a security vulnerability, please use the \href{https://tidelift.com/security}{\texttt{ Tidelift security contact}}. Tidelift will coordinate the fix and disclosure.

\DoxyHorRuler{0}


 {\bfseries{ \href{https://tidelift.com/subscription/pkg/npm-es6-symbol?utm_source=npm-es6-symbol&utm_medium=referral&utm_campaign=readme}{\texttt{ Get professional support for d with a Tidelift subscription}} }} ~\newline
 \textsubscript{ Tidelift helps make open source sustainable for maintainers while giving companies~\newline
assurances about security, maintenance, and licensing for their dependencies. }  