<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by QJ Li on Medium]]></title>
        <description><![CDATA[Stories by QJ Li on Medium]]></description>
        <link>https://medium.com/@qjli?source=rss-29deaa7ffd0d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*42WrXZ0i0Aa3IYn8k1988w@2x.jpeg</url>
            <title>Stories by QJ Li on Medium</title>
            <link>https://medium.com/@qjli?source=rss-29deaa7ffd0d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 14:56:42 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@qjli/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[MacOS Monterey Bluetooth issue]]></title>
            <link>https://medium.com/@qjli/macos-monterey-bluetooth-issue-6bb2f2d1c652?source=rss-29deaa7ffd0d------2</link>
            <guid isPermaLink="false">https://medium.com/p/6bb2f2d1c652</guid>
            <category><![CDATA[bluetooth]]></category>
            <category><![CDATA[macbook-pro]]></category>
            <category><![CDATA[macbook]]></category>
            <category><![CDATA[mac]]></category>
            <dc:creator><![CDATA[QJ Li]]></dc:creator>
            <pubDate>Wed, 12 Jan 2022 02:11:29 GMT</pubDate>
            <atom:updated>2022-01-12T02:11:29.040Z</atom:updated>
            <content:encoded><![CDATA[<p>Just realise this annoying bluetooth issue is still not yet fixed in <strong>12.1</strong> after so many months, which means we can’t pair any airpod etc via macbook 😭</p><p><a href="https://developer.apple.com/forums/thread/694146">MacOS 12.0.1 Monterey Bluetooth is... | Apple Developer Forums</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pYlp6ctc0wmfw022GEebUQ.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6bb2f2d1c652" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Do you know these weird parts of JavaScript?]]></title>
            <link>https://medium.com/@qjli/do-you-know-these-weird-parts-of-javascript-63f0f4c4e0b4?source=rss-29deaa7ffd0d------2</link>
            <guid isPermaLink="false">https://medium.com/p/63f0f4c4e0b4</guid>
            <category><![CDATA[js]]></category>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[QJ Li]]></dc:creator>
            <pubDate>Sat, 20 Jul 2019 09:33:48 GMT</pubDate>
            <atom:updated>2019-07-20T09:40:37.708Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/200/0*cQB6BjF-6ZnVfZvQ.gif" /><figcaption>OMG…</figcaption></figure><pre>&gt; 0.1 + 0.2<br>0.30000000000000004</pre><pre>&gt; 1 + “23” - 10<br>“113”</pre><pre>&gt; null == undefined<br>true</pre><pre>&gt; NaN == NaN<br>false</pre><pre>&gt; typeof null<br>&quot;object&quot;</pre><pre>&gt; typeof NaN<br>&quot;number&quot;</pre><pre>&gt; [&#39;1&#39;, &#39;7&#39;, &#39;11&#39;].map(parseInt)<br>(3) [1, NaN, 3]</pre><pre>&gt; function foo() {<br>    return <br>    <strong>{</strong><br>      foo: &#39;bar&#39;<br>    <strong>}</strong><br>  }</pre><pre>foo()<br>&lt; <strong>undefined</strong></pre><pre><br>&gt; function bar() {<br>  return <strong>{</strong><br>    foo: &#39;bar&#39;<br> <strong> }</strong><br>}</pre><pre>bar()<br>&gt; <strong>{foo: &quot;bar&quot;}</strong></pre><pre>&gt; [] + []<br>&quot;&quot;</pre><pre>&gt; {} + {}<br>&quot;[object Object][object Object]&quot;</pre><pre>&gt; [] + {}<br>&quot;[object Object]&quot;</pre><pre>&gt; {} + []<br>0</pre><pre>&gt; +!+[]<br>1</pre><pre>3 &gt; 2<br>true</pre><pre>3 &gt; 2 &gt; 1<br>false</pre><pre>&gt; function Test() {<br>}()</pre><pre>Uncaught SyntaxError: Unexpected token )</pre><pre>&gt; var test = function() {}<br>undefined</pre><h3>References:</h3><ul><li><a href="https://blog.mgechev.com/2013/02/22/javascript-the-weird-parts/">JavaScript, the weird parts</a></li><li><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Operator_Precedence">Operator precedence - JavaScript | MDN</a></li><li><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Expressions_and_Operators#Arithmetic">Expressions and operators</a></li><li><a href="https://wtfjs.com/">wtfjs - a little code blog about that language we love despite giving us so much to hate</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=63f0f4c4e0b4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[VSCode Tips: column (box) selection]]></title>
            <link>https://medium.com/@qjli/vscode-tips-column-box-selection-98eab97e7f01?source=rss-29deaa7ffd0d------2</link>
            <guid isPermaLink="false">https://medium.com/p/98eab97e7f01</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[vscode]]></category>
            <category><![CDATA[tips-and-tricks]]></category>
            <category><![CDATA[tips]]></category>
            <dc:creator><![CDATA[QJ Li]]></dc:creator>
            <pubDate>Sat, 20 Jul 2019 01:35:54 GMT</pubDate>
            <atom:updated>2019-07-20T01:38:55.552Z</atom:updated>
            <content:encoded><![CDATA[<p>Column selection is a very handy tool when you need to edit column of text at the same time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4QMJUGQqrXe7lUGa2ikwVA.gif" /><figcaption>VSCode column selection demo</figcaption></figure><h3>Shortcuts:</h3><p>Place the cursor in one corner and then hold <strong>Shift+Alt </strong>while dragging to the opposite corner. You can use keyboard arror up/down to place more cursors on the lines you want to edit. Press <strong>[ESC] </strong>key to exit the multicusor mode.</p><h3>More reference from VSCode site:</h3><p><a href="https://code.visualstudio.com/docs/editor/codebasics#_column-box-selection">https://code.visualstudio.com/docs/editor/codebasics#_column-box-selection</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=98eab97e7f01" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Daily Dev Tips №110 — how to export jest test results]]></title>
            <link>https://medium.com/@qjli/daily-dev-tips-110-how-to-export-jest-test-results-f31b9ad0795e?source=rss-29deaa7ffd0d------2</link>
            <guid isPermaLink="false">https://medium.com/p/f31b9ad0795e</guid>
            <category><![CDATA[js]]></category>
            <category><![CDATA[tips-and-tricks]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[tips]]></category>
            <category><![CDATA[jest]]></category>
            <dc:creator><![CDATA[QJ Li]]></dc:creator>
            <pubDate>Thu, 18 Jul 2019 07:27:53 GMT</pubDate>
            <atom:updated>2019-07-18T07:27:53.536Z</atom:updated>
            <content:encoded><![CDATA[<h3>Daily Dev Tips №110 — how to export jest test results</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/796/1*SruahLTSYt6Oo8MKhTMI6w.png" /></figure><h3>structure (json format) output:</h3><pre>npm test -- --json --outputFile=output.json</pre><h3>non-structure output:</h3><pre>npm test --no-color 2&gt;output.txt</pre><p><a href="https://jestjs.io/docs/en/configuration#testresultsprocessor-string">Configuring Jest · Jest</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f31b9ad0795e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Daily cleanup tips: Gmail / Google Drive clean up]]></title>
            <link>https://medium.com/@qjli/daily-cleanup-tips-gmail-google-drive-clean-up-8314ecb89b8f?source=rss-29deaa7ffd0d------2</link>
            <guid isPermaLink="false">https://medium.com/p/8314ecb89b8f</guid>
            <category><![CDATA[google-drive]]></category>
            <dc:creator><![CDATA[QJ Li]]></dc:creator>
            <pubDate>Fri, 12 Jul 2019 07:16:37 GMT</pubDate>
            <atom:updated>2019-07-12T07:16:37.843Z</atom:updated>
            <content:encoded><![CDATA[<h3>Gmail:</h3><p>In search box:</p><p>larger:5M</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4d4YAkSn8aL-k-7i19dP_Q.png" /><figcaption>Gmail search for big files</figcaption></figure><h3>Google Drive:</h3><p><a href="https://drive.google.com/drive/quota">https://drive.google.com/drive/quota</a></p><p>then you will be able to see the file size columns of all of the files in your google drive</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LZr2GEBsW9TwVPX3Mw3UCA.png" /><figcaption>Google Drive Clean up</figcaption></figure><p>Also, check your Google Photos to see if you can remove the photos and backup somewhere else.</p><p><a href="https://photos.google.com/albums">https://photos.google.com/albums</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8314ecb89b8f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Daily Dev Tips №109 — The fastest way to convert array like object into js array]]></title>
            <link>https://medium.com/@qjli/daily-dev-tips-109-the-fastest-way-to-convert-array-like-object-into-js-array-bb3065b89066?source=rss-29deaa7ffd0d------2</link>
            <guid isPermaLink="false">https://medium.com/p/bb3065b89066</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[tips-and-tricks]]></category>
            <category><![CDATA[tips]]></category>
            <category><![CDATA[es6]]></category>
            <dc:creator><![CDATA[QJ Li]]></dc:creator>
            <pubDate>Fri, 10 May 2019 07:40:23 GMT</pubDate>
            <atom:updated>2019-05-10T07:40:23.960Z</atom:updated>
            <content:encoded><![CDATA[<h3>Daily Dev Tips №109 — The fastest way to convert array like object into js array</h3><h3>1. What is the problem?</h3><p>Suppose you have a list of divs on your page and you query them via document.querySelectorAll .</p><pre>&gt; let rows = document.querySelectorAll(&#39;img&#39;)<br>   NodeList(11) </pre><p>However, rows is not an array that you can manipulate with all of the handy array methods, like map(), filter()etc</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4MkBJprFSx6GXT4os8b-4g.png" /><figcaption>oops, I am not an array, buddy</figcaption></figure><p>That is because</p><blockquote>NodeList object is a list (collection) of nodes extracted from a document.</blockquote><h3><strong>2. What can I do?</strong></h3><p>The easiest, fastest way to convert it into an array is just using es6 spread operator.</p><pre>let rows = document.querySelectorAll(&#39;img&#39;);<br>rows = <strong>[...rows]</strong></pre><p>Now, you can start applying all of the array methods to this rows</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dxLqg6bhRVEyDl9nHzKJwA.png" /><figcaption>get me those images that I want!</figcaption></figure><h3>3. Other ways to solve the problem here</h3><p>1.) use es6 spread operator<strong> […arrayLikeObject]<br></strong>2.)<strong> </strong>use<strong> </strong>es6<strong> Array.from</strong>(arrayLikeObject)<strong><br></strong>3.) <strong>[].slice.call</strong>(arrayLikeObject)<br>4.) use the good old <strong>for</strong> loop, code snippet is below, feel free to copy it, LOL</p><pre><strong>4.) use the good old for loop, please copy and use, haha</strong></pre><pre>let trueArray = []<br>for(let i = 0; i &lt; rows.length; i++) {<br>   trueArray.push(rows[i])<br>}</pre><p>If you know any other ways, feel free to leave a comment below!</p><h4>Thanks for reading! 🎊 If you find this helpful don’t forget to give some claps 👏🏻 and feel free to share this with your friends and followers! 🙏If you have some tips to share, feel free to comment below.</h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bb3065b89066" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Daily Dev Tips №108— VS Code — Jest coverage tool]]></title>
            <link>https://medium.com/@qjli/daily-dev-tips-108-vs-code-jest-coverage-tool-c0313ef2165f?source=rss-29deaa7ffd0d------2</link>
            <guid isPermaLink="false">https://medium.com/p/c0313ef2165f</guid>
            <category><![CDATA[vscode]]></category>
            <category><![CDATA[tips]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[front-end-development]]></category>
            <dc:creator><![CDATA[QJ Li]]></dc:creator>
            <pubDate>Wed, 03 Oct 2018 11:52:35 GMT</pubDate>
            <atom:updated>2018-10-03T11:52:35.347Z</atom:updated>
            <content:encoded><![CDATA[<h3>Daily Dev Tips №108— VS Code — Jest coverage tool</h3><p>If you are using VS Code and you are writing unit tests, then this extension is very handy for you.</p><p>It is called Coverage Gutters , it displays test coverage generated by lcov or xml — works with many languages.</p><p>Almost all of the test coverage tools I used can all generate coverage results as lcov or xml or json format, so, this tool will just work out of the box for you if you are using jest.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WopiPIsfPwGdAH2E6yA61w.png" /><figcaption>vs code — coverage gutters</figcaption></figure><p>By default, jest coverage coverageReporters uses [&quot;json&quot;, &quot;lcov&quot;, &quot;text&quot;]</p><p>So once you run jest --coverage and generate the coverage reports, then open up any of the js file and you can see the line coverage results right in the IDE.</p><p>If the inline highlight does not show, you can open up the command pallets and type gutter and select the Display Coverage option.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o2BeHTQkg3YYneMpwMPdCg.png" /><figcaption>vs code — coverage gutter</figcaption></figure><h4>Thanks for reading! 🎊 If you find this helpful don’t forget to give some claps 👏🏻 and feel free to share this with your friends and followers! 🙏If you have some tips to share, feel free to comment below.</h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c0313ef2165f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Daily Dev Tips №107 — reactjs how to add dynamic class]]></title>
            <link>https://medium.com/@qjli/daily-dev-tips-107-reactjs-how-to-add-dynamic-class-8fbdd1789bac?source=rss-29deaa7ffd0d------2</link>
            <guid isPermaLink="false">https://medium.com/p/8fbdd1789bac</guid>
            <category><![CDATA[tips]]></category>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[QJ Li]]></dc:creator>
            <pubDate>Sat, 29 Sep 2018 08:49:53 GMT</pubDate>
            <atom:updated>2018-09-29T08:49:53.077Z</atom:updated>
            <content:encoded><![CDATA[<p>There are a few ways you can achieve it.</p><h3>1. use string concatenate or es6 template</h3><pre>&lt;div className={&#39;container &#39; + this.state.something}&gt;&lt;/div&gt;</pre><pre>&lt;div className={`container ${this.state.something}`}&gt;&lt;/div&gt;</pre><h3>2. use <a href="https://github.com/JedWatson/classnames">classnames</a> npm package</h3><p>classnames is a simple javascript utility for conditionally joining classNames together.</p><pre>const btnClass = classNames({<br>  btn: true,<br>  &#39;btn-pressed&#39;: this.state.isPressed,<br>  &#39;btn-over&#39;: !this.state.isPressed &amp;&amp; this.state.isHovered<br>});</pre><pre>&lt;button className={btnClass}&gt;{this.props.label}&lt;/button&gt;;</pre><h4>Thanks for reading! 🎊 If you find this helpful don’t forget to give some claps 👏🏻 and feel free to share this with your friends and followers! 🙏If you have some tips to share, feel free to comment below.</h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8fbdd1789bac" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Daily Dev Tips №106 — Chrome DevTools — Eager evaluation from Console]]></title>
            <link>https://medium.com/@qjli/daily-dev-tips-106-chrome-devtools-eager-evaluation-from-console-68521168d82d?source=rss-29deaa7ffd0d------2</link>
            <guid isPermaLink="false">https://medium.com/p/68521168d82d</guid>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[chrome]]></category>
            <category><![CDATA[tips]]></category>
            <dc:creator><![CDATA[QJ Li]]></dc:creator>
            <pubDate>Thu, 27 Sep 2018 11:34:46 GMT</pubDate>
            <atom:updated>2018-09-27T11:35:13.429Z</atom:updated>
            <content:encoded><![CDATA[<p>Chrome 68 introduced this nice little feature called <a href="https://developers.google.com/web/updates/2018/05/devtools#eagerevaluation">eager evaluation</a> in the DevTools Console.</p><h3>1. What is Eager evaluation?</h3><blockquote>When you type an expression in the Console, the Console can now show a preview of the result of that expression below your cursor.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P40jE3iG7omDjfCGHqYJWQ.png" /><figcaption>chrome devTools — eager evaluation, grey preview</figcaption></figure><p>As you can see the grey preview of the evaluation of the express here in Console.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GyX7X4zFetIoq668HkW8RA.png" /><figcaption>chrome devtools — press enter key to show the result for the expression</figcaption></figure><h3>2. How to enable it?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RvPHORTpvACeIye3ULwk1w.png" /><figcaption>chrome devtools — enable Eager evaluation in the Console</figcaption></figure><h4>Thanks for reading! 🎊 If you find this helpful don’t forget to give some claps 👏🏻 and feel free to share this with your friends and followers! 🙏If you have some tips to share, feel free to comment below.</h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=68521168d82d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Daily Dev Tips №105 — JavaScript exponentiation (**) operator support]]></title>
            <link>https://medium.com/@qjli/daily-dev-tips-105-javascript-exponentiation-operator-support-3a4f0a11a22f?source=rss-29deaa7ffd0d------2</link>
            <guid isPermaLink="false">https://medium.com/p/3a4f0a11a22f</guid>
            <category><![CDATA[chrome]]></category>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[tips]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[QJ Li]]></dc:creator>
            <pubDate>Wed, 26 Sep 2018 09:53:42 GMT</pubDate>
            <atom:updated>2018-09-26T09:53:42.913Z</atom:updated>
            <content:encoded><![CDATA[<p>When I was learning Python, I am very jealous about python developers, they have one of the most powerful math library out of the box. One of the features I love is the <strong>**</strong> operator. It is so neat.</p><pre>$ 2 ** 2 <br>4</pre><pre>$ 2 * 10 <br>1024</pre><p>Luckily, <a href="https://www.ecma-international.org/ecma-262/7.0/#sec-exp-operator">ECMAScript 2016 spec </a>(es7) introduced this feature and Chrome has implemented this exponentiation (**) operator since version 52, even Edge 14 has implemented it.</p><p>Before this, you need to use the Math.pow(x, y) , but now, open up your <strong>Chrome DevTools</strong> -&gt; <strong>Console</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_HemWzLNQ5vr7ZtcMTgfSQ.png" /><figcaption>chrom devtools — 2 ** 10</figcaption></figure><p>Also, you can do exponentiation assignment too.</p><pre>const num = 2<br><strong>num **= 10</strong> // equivalent to <strong>num = num ** 10<br></strong>// num will be <strong>1024</strong></pre><pre>num **= &#39;hi&#39;<br>// num will be <strong>NaN</strong></pre><p>More details, you can check out <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Assignment_Operators#Exponentiation_assignment#Exponentiation_assignment_2">here</a>.</p><h4>Thanks for reading! 🎊 If you find this helpful don’t forget to give some claps 👏🏻 and feel free to share this with your friends and followers! 🙏If you have some tips to share, feel free to comment below.</h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3a4f0a11a22f" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>