X Tutup
The Wayback Machine - https://web.archive.org/web/20200920172833/https://github.com/HowProgrammingWorks/DataTypes/pull/82
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DataTypes exercises 1-4 #82

Open
wants to merge 5 commits into
base: master
from
Open

Conversation

@azozulya
Copy link

azozulya commented Sep 18, 2019

No description provided.

@@ -1,5 +1,4 @@
'use strict';

const fn = null;
const fn = x => { const arr1 = [1, 2, 3]; for (const i of arr1) (i * x); };

This comment has been minimized.

@tshemsedinov

tshemsedinov Sep 22, 2019 Member

Rewrite to multi-line

const typesMass = {};
for (const el of arr) {
const t = typeof el;
typesMass[t] = (t in typesMass) ? typesMass[t] + 1 : 1;

This comment has been minimized.

@tshemsedinov

tshemsedinov Sep 22, 2019 Member

Use if statement and additional variable to make it readable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.
X Tutup