instruction
stringlengths
71
95.1k
To develop my understanding of C++, I've written an overload function that allows users to use & to insert strings within other strings (denoted by a $ character). So far, it only works with one replacement in a string. For example: "Hello $" & "World" -> "Hello World" I want to receive feedback, because I'm sure ther...
I have an HTML table, and I would like to remove columns where the sum vertically is 0 dynamically. let ths_columns = [...document.querySelectorAll("thead tr th")].map( (th) => th.textContent.trim() ); //first row of table header [ "column_1", "column_2", "column_3", "column_4" ] let trs = [...document.querySelect...
As you can see I am using a counter variable to iterate through my JSON file and it's a dictionary that has a list of dictionaries. Once I find the key normalHours I divide it and add it to my dictionary hours_per_week. Then I update the dictionary it is associated with. Is it better to use for i in range instead of th...
I had to solve this problem yesterday on Codility as part of a job interview. At the end, even though my code passes the initial 3 tests, it failed most of the other tests (which are hidden) and it also failed most of the performance tests. And now I'm puzzled as to why and I was hoping somebody would shine a light on ...
The following scripts calculate a list with the number of people occupied at each time interval. The intervals are defined by the timestamps of two consecutive events that come from the sorted list events_timeline. Also, start_ts and end_ts are taking into account for intervals calculation and for each event, one perso...
I often want to program in an event driven way, but classic implementations of the observer pattern often pose an ownership challenge, and they only get more difficult once multiple threads are involved. This approach uses a polling loop in a thread (but not busy waiting), and "notifies the observer" (calls a call-back...
This is a simple text-based adventure game I made. I'm a beginner and I want to know if the code is optimal or if it can be improved. The story is not very complex, but I made it more for practicing coding. print("Welcome " + name +"!") start = input("Do you wish to begin your adventure? ").lower() if start == "yes": ...
Given a positive integer n, I would like to randomly output n non negative integers that sum to m (a positive integer).The output should be presented as a list of integers (not sorted). My random sample should be uniformly sampled from all lists of n non negative integers that sum to m. You can do this using a method i...
I'm sorting a Dictionary in a lexicographical order and applying MD5 encryption. I would like to wrap the sorting somewhere inside the encryption method or so. Official Java example - here Docs private static string GenerateSign(Dictionary<string, object> query, string apiSecret) { var sb = new StringBuilder(); ...
I need to generate column a_b based on column a and column b of df, if both a and b are greater than 0, a_b is assigned a value of 1, if both a and b are less than 0, a_b is assigned a value of -1, I am using double np.where . My code is as follows, where generate_data generates demo data and get_result is used for pro...
I have this DB class that extends PDO, that also has useful functions for certain tasks; I was wondering how well it's coded, and if so, what I could maybe improve on. I tried commenting in PHPDoc to explain each functions usage, but if any are confusing, don't hesitate to let me know so I can try and explain it a bit ...
I have a function below, store_in_matchid_file, and it adds certain strings to a .txt file as long as that string doesn't already exist in the file. However that file is getting to be millions of lines long and the process of checking is becoming too long. I was hoping someone would be able to indicate a way I could sp...
Hi I am working on application which will manage expenses in group of users. I would like to know, how to most effectively get final settlement instructions for users. I have came up with this: @Override public Map<Pair<User, User>, BigDecimal> getSettlementInstructions(Group group) { Map<Pair<User, User>, ...
getFinalImageData(:UIImage) takes a UIImage and downscales its size dimensions (to 400 points, in this example) and returns it as Data that has been compressed to be within the byte limit (using the two UIImage extensions). This function works great but I would love to get some other eyes on it. typealias Bytes = Int64...
I started playing Pathfinder: Kingmaker, and very soon ended up in a room with 6 levers, and a task to open a secret door by manipulating the levers. I assumed that the correct position for all the levers is up. But when you flip a single lever, one or two other levers also flip. For example, if you flip lever one, the...
I am a beginner in C language. I studied all night and did my assignment. But I wonder if there is a more efficient way. The original structure is this. typedef struct student { int id; int prob_1; int prob_2; int prob_3; int total_score; char grade; }Student I used typedef to change it to Stud...
Made a simple snake game using C and raylib for graphics, Would like to be critiqued on the clearity and efficiency of the code. #include <raylib.h> #include <stdlib.h> #include <stdio.h> #include <string.h> #include <stdbool.h> #define DIRECTION_UP (Vec2i){0, -1} #define DIRECTION_DOWN (Vec2i){0, 1} #define DIRECTIO...
based on this stackoverflow topic: https://stackoverflow.com/a/12150289/15270760 I have decided to create a simple NTP client displaying difference between NTP server response and DateTime.Now called right after receiving NTP response. I was just curious of the result. I have read both RFC's 2030 and 1305 and it appere...
I'm fairly new to coding and am trying to learn more about best practices. I wanted to have an nestedArray of objectArrays, and I wanted to be able to sort the elements in each objectArray based on matching certain property values with some in the preceding objectArray. This is what I came up with (below). It works, bu...
For apps which don't have significant layout changes between the iPhone and iPad versions, I usually set the constraints of all UI elements (views, labels etc.) as fractions of the current device screen's width and height, in order to scale the content for different sizes and aspect ratios. The way I currently do this ...
Exponential Search is an optimization over binary search. Conceptually, when searching for a number target in a list of numbers nums, exponential search first finds into which power-of-two sized bucket nums[2**p: 2**(p+1)] the target falls into. E.g., if nums has a size of 30, then the buckets are nums[0:1], nums[1:2],...
This is my accepted submission for LeetCode. The problem is You are given a 0-indexed integer array nums. An index i is part of a hill in nums if the closest non-equal neighbors of i are smaller than nums[i]. Similarly, an index i is part of a valley in nums if the closest non-equal neighbors of i are larger than nums...
I wrote this script to figure out which users have the largest vocabulary on my irc server. I would like to see if there's any way to clarify what I consider a very quick script. It outputs a CSV without a header of user, their unique words, most common words and the use of those words. import sys import json import st...
Just practicing some objected oriented design questions. Please let me know what can be improved to be more OOD and extensible. Thank you. Functional Requirements Cart can hold multiple products A product has a name and price. Name is unique. Should show the total price Should show itemized price Should be able to add...
I am working with JSON API data in .NET6 and was having trouble de-serializing nested data that has a variable rootname since my class type will never match what's in the JSON string. { "???":{ "type":"static", "description":"n/a", "id":null, "upc":"s324df", "price":1802 } } in the ...
Problem I am creating a generic LRU Cache in Java. The LRU Cache should have \$\mathcal{O}(1)\$ set/get complexity. It is not expected to be thread safe. Feedback I would especially like your feedback on: Code readability & naming Areas of redundancy I am personally debating whether the RecencyQueue should live as a ...
I'm new to coding but I'm particularly new to python. I wrote a program that will determine a diver's table and schedule(because it relates to my job). It essentially assigns a value from multiple lists based on a given int(bottom time), and another given int(depth) as well as a given string associated with those to in...
Considering the suggestion of using modern string arrays instead of char vectors proposed by Cris Luengo, I am trying to make a code snippet for performance comparison of these two cases. The experimental implementation %% Print system information system('systeminfo'); %% Setup: test parameters concatTestTimes = 25; r...
This is my first question so please let me know if this is too vague/broad and I will do more research on question asking. I have implemented a handful of data loaders in C#, and have come to the point where I have what I consider in my limited experience a decent structure, but I'm not confident in implementing the me...
What is a more efficient way of writing this sample code? Its purpose is to create a variable for days of the week based on a numerical value. This data is obtained from user input checkboxes. If the user doesn't select any options, they will be assigned the Online value. Fiddle here - https://3v4l.org/Sghnh#v7.4.30 ...
Practicing objected oriented design. This time, it's designing the TicTacToe game. One difference between the real TicTacToe game is that I've made my TicTacToe game to have variable sized board. Please review in terms of OOD and I've also left some comments in my code where I want feedback in particular. Thank you ver...
Here is my type safe dynamic array. I'm eventually going to make a hash table in C. I'm just wondering if anything seems wrong or out of place. Thanks. #ifndef DARRAY_HEADER_INCLUDED #define DARRAY_HEADER_INCLUDED #include <stdlib.h> #include <assert.h> #include <string.h> #define darray_deff(name, type)\ struct n...
defmodule Combination do def combine([]) do [] end def combine([head | tail]) do tail_combinations = combine(tail) merged_combinations = Enum.map( [[]] ++ tail_combinations, fn c -> c ++ [head] end ) tail_combinations ++ merged_combinations end end This Elixir function produces...
Here is the script that I would like reviewed for the following: Best practices and design pattern usage Correctness in unanticipated cases Possible error checking Any streamline updates/ideas are welcome! import os import tarfile import time # Create backup filename timestr = time.strftime("%Y-%m-%d:%H%M%S") output...
The following is a Scheme procedure to permute the characters in an input string. It outputs permutations of all lengths from 1 character up to the number of characters in the input string. Duplicates are not part of the output list. The code is written in Chez Scheme and can be executed from the command line using s...
This is actually my version of a project I'm giving to my class of High School juniors. I'm not the greatest programmer and also a new teacher so I was hoping someone could check out this code and give me any suggestions or advice they see on it. Please just keep in mind that it's written to be at a High School student...
I've been reviewing some code that I maintain recently, and I came across this wrapper object for the serial port class. I'm trying to understand the advantage of this seemingly redundant object: Public Class SerialPort_Class Private WithEvents Serial_Port As IO.Ports.SerialPort Private SerialPort_ReOpen_Flag As Boole...
I am parsing a document and returning (1) uniqueness, and (2) total number occurrence. I believe my code can still be subjected to review. I would like a review of my code as I have even made it too tightly coupled, and some Dependency Injection would be a nice to have. How can I make this code better? links.log (input...
Yes, another PHP form builder... I wrote this solely to demonstrate OOP principles. My questions are: Could this be written better? OOP-wise. How could I better implement error handling? Index.php <?php require __DIR__ . '/vendor/autoload.php'; use FormBuilder\FormGenerator as Form; use FormBuilder\TextField as Text...
I have a program that works okay (not fully completed) however, I would like to simplify things and create some classes and different .py files for my tkinter app as I feel that would help organize everything better. I think where the confusion for me lies is how does each .py file class or function call to the main wi...
I'm a beginner in front-end development and tried to make a dropdown menu that includes the toggle button within the menu, instead of opening a separate menu besides the toggle button. I went with such approach because I want to apply either a border or a shadow (like in my example) around the whole menu and toggle but...
I've been learning Haskell for 2 weeks now which is I'm very new to it. I would like to have feedback on what is good/bad about my code and how it could I improve in learning functional programming paradigm. {-- Number guessing game -- Generate a random number between 1 and 100 -- Ask the user to guess the ...
The following code was written to create custom directory listings for the Abyss Web Server. It attempts to provide an improved example of the included documentation for doing so in Python. However, some modules such as cgi and cgitb are deprecated and should be replaced to modernize this example code even more. Could ...
This is my first post here, as I just started learning a bit of code pretty recently through "Automate Boring Stuff". In one exercise, to learn about dictionaries, it was shown how to build a tic tac toe board where players could place their marks. I decided to try to use the exercise as a basis and create the rest of ...
So I decided to lookup some algorithms, and one of the ones I found was.. "Check if the string is an anagram" and without using Google for more than checking what an anagram is, I decided to write some code. What the code is doing is that it takes two strings. car and arc for instance, and then it takes the first chara...
Task I was asked to write a function, which can determine (return a bool) whether 2 given strings are anagrams of each other? That function should have the following constraints: Upper and lowercase letters are considered the same Non-letters (so numbers, punctuation, whitespace) should be ignored My implementations:...
The following method of printing all subarrays(contiguous subsequences) of an array is faster as compared to the general method of using three nested for loops: #include <iostream> #include <vector> int main() { std::vector<int> array; int N; std::cin >> N; //size of array for (int i = 0; i < N; i++) { int x; std::ci...
I have a volunteer registration website that I wrote some end-to-end tests for in Selenium. Selenium is of course software that lets you automate clicking around a browser, which makes it great for testing websites. This is my first time working with Selenium. I got some tests working and they are very helpful. But the...
I am a beginner at programming. I made this snake game in JavaFX to practice and improve my coding skills. I tried to make my code clean, but I'm not sure if it is, or if it is well-organized. I also tried to make the design object-oriented. So I would like to ask your opinion on my code's structure and clarity. I woul...
I am wondering which one I should choose between the following two options when I need to calculate the sum of Data of the student with Id of 1. var out1 = students .Select(x => new { Id = x.Id, Sum = x.Data.SelectMany(n => n).Sum() }) .FirstOrDefault(s => s.Id == 1) .Sum; var out2 ...
I was asked to write a code in C++ using threads, in which I have to have two limits and 4 characters. Characters can go inside the area limited at the same time when they approach from opposite sides. In addition, a ball moving forward and backwards affects the process in such a way that when the ball is inside the ar...
The structure of the JSON is as such: Each parent record can have many DataGroups and each DataGroup can have many DataSets and each DataSet can have many DataFields. What I've done is add a new property called columns on each DataSet. columns is a mapped array of simplified objects based on the DataFields of each Data...
(See also the next iteration.) I have rolled this short program that converts int values to the human readable strings: package com.github.coderodde.fun; import java.util.HashMap; import java.util.Map; import java.util.Scanner; public class IntToHumanReadableStringConverter { private static final Map<Integer...
I am a newbie in Python and would very much need help in arranging and setting out function. I have programmed a number guessing game. The outlook of the program is very messy but I don't where to fix since my Python knowledge is very limited. import random def random_num(): # bound preferences and number of trial...
I'm trying to rewrite one of my pet projects in Rust, and when I was faced with the problem of filtering a Result<Option<T>, E> via a Result<bool, E>, I couldn't figure out what the best approach was. Since I'll be doing the same thing many times throughout the project I need something that's generic while also being r...
I wrote the scripts several days ago, they do exactly what I intended, but the performance is not very good, I am still stuck on for loops and don't know how to vectorize things, I wrote both scripts entirely by myself. One script creates Fractal Canopy: Step by step on how the coordinates are calculated: First, ...
doing hackerrank challenges and been learning python3 for a month now, made this code to convert and return 12 hour to 24 hour time format in one of the challenges s ="05:43:12PM" #s normally is input, but this code will only work with this type of string input def timeconversion(s): # Write your code here l = li...
I have a small Python application that needs to load a few different files (templates and config files). It should look in a number of destinations, in the following order, and load the file from the first destination that contains such a file. current working directory $MYAPP_PATH (may contain several paths,separated...
This is a file dump program written in assembly that displays 320 bytes at a time in 20 lines. It shows the hex code for each character and also the string At the start of the program it asks for the name of the file and starts dumping. After each dump it asks if they want to see more. x86 64bit NASM %macro input 1 ...
I started my python journey 4 days ago. I am following a Youtube tutorial currently to understand the basics of Python. So bear in mind that I am REALLY new to this. I wanted to test myself a little so I Googled for a really basic program that I could try to make. I decided on a Guessing the number game (very original)...
I am parsing a file that exists in either app/components/ui or in app/components. If the one in the first dir (app/components/ui) doesn't exist, then fallback to the app/components directory. This is what I have currently. def front_matter return unless params[:filename].present? path = Rails.root.join('app'...
Now, I have extended my program taking some answers in the previous iteration into account: package com.github.coderodde.fun; import java.util.ArrayDeque; import java.util.Deque; import java.util.HashMap; import java.util.Map; import java.util.Scanner; public class LongSpeller { private static final class BigNum...
I am trying to compute the multiplicative inverse of a large matrix (~ >40,000x40,000). This can be done with e.g. numpy.linalg.inv or scipy.linalg.inv. Unfortunately, the calculation fails on the HPC to which I have access. numpy.linalg.inv(I-A) or scipy.linalg.inv(I-A) is equivalent to (I-A)^-1 which can be approxima...
I am building a basic authentication system with a node backend and wonder whether I am using the try-catch block excessively. I have this example controller: export const getUser = async (req: Request, res: Response) => { try { const user = await User.findById(req.body.id); if (!user) { return res.sta...
I attended job interview and on live codeing session was asked to implement code based on some requirements. There are quite long text description but idea that we have to accept some file system path and run some files if they satisfy some name pattern and depends on pattern SqlRunner should call different methos. I ...
I had to make a program that have an array of numbers, and then I need to make a function that get the arr[0] and the length of the array, and then it will print all the numbers without the duplicate ones. I made this program and it worked well but I feel like I used too many variables for this program. (I started to l...
Problem Statement Given a string s , return the longest palindromic substring in s. Constraints 1 ≤ s.length ≤ 1000 s consist of only digits and English letters. Algorithm Now, there are \$\frac{n(n+1)}2\$ substrings, if a string has length \$n\$. Because there are \$n-k+1\$ substrings of length \$k\$. Thus, tot...
The code below transforms the text area's input to camelCase. I am wondering if this code is considered correct to write in terms of performance and readability and if not, what are your improvements? This accepts only values with an underscore, use this test data in the text area: underscore_case first_name Some_Varia...
This is an actual work problem we had to solve. Put simply: given a structure (e.g. nested dictionaries) and a mapping of old dictionary keys to new ones, produce a new structure that is anatomically identical to the original, uses the new dictionary keys, and preservers every other value. How to encode this mapping? ...
I am a beginner programmer and have written a program that sorts a number of integers of your choosing using bogo sort. Are there any improvements that could be made to make this code more efficient (ironic, but you get the idea)? Are there any ways to make this code easier to read for someone else? #include <iostream>...
So I have the following algorithm. Given an array A[0 ... n - 1] and the window length w, compute all the windows A[0 ... w - 1], A[1 ... w], ..., A[n - w, n - 1], and for each window, in order, compute the maximum integer in the window, storing it in a result array: import java.util.Arrays; import java.util.HashMap; i...
I wrote this code some time ago as part of the web-scraping learning. Every now and then I find mistakes in it, as well as I have doubts. Feedback please, is this code compliant with the common best practices? Any comments will be useful. # crawler_her_sel.py # -*- coding: utf-8 -*- import time from selenium.webdrive...
While trying to write a game engine, I came up with this ECS / Component Based Architecture for its physics and drawing logic. I want to get some feedback on its architecture. I am using reflection inside the querying code and to get a class's superclass. Is this bad design in this case? Note that I left out most docum...
I'm currently learning some aspects of PEP8 and Python programming in general. Could you please code-review this little piece of code for me? I would be glad to hear any, even the smallest comments, thanks! from array import array from typing import NamedTuple from pycoingecko import CoinGeckoAPI cg = CoinGeckoAPI() s...
New to C++ here, by combining different pieces of code I've found, i came with this solution below to convert a date in string to a date object. It works as I want but I'm not certain to do the simplest thing. #include <iostream> #include <iomanip> #include <sstream> #include <chrono> #include <ctime> int main(void)...
I'm writing a Discord bot that sometimes requires a Minecraft account UUID to be looked up so this is the function (and MWE) I have written to do this. 'use strict'; const axios = require('axios'); const EDITION = { JAVA: 0, BEDROCK: 1, }; async function getUuid(username, edition) { try { const r...
I have no IT background and taught myself Java and made a simple Tetris game. I compared my code on the internet with other tutorials. My first impression of those implementations is that they are very complex: Shape-classes, No-Shape-shape, rotation arrays etc. The location of a shape in the grid is also the shape's c...
The first request is sent asynchronously, then the id value is taken from the response to the first request and used in the second asynchronous request. And then both responses to request 1 and request 2 are combined. The example below works, but the code looks so clunky. Is there a better, shorter way to implement thi...
I have an array of users containing user name with their rules on my practice project I have generated a table in HTML from that array in JS, So I can change the status of any user rule by toggling on cell, or toggling all rules by clicking on name of user, or deny or grant rules for all users by clicking on column ve...
I started my Python Journey almost a week ago from now. I had been following a Youtube tutorial earlier, but switched to Harvard's CS50P instead. I decided on making a little Quiz Game with my programming knowledge so far. I know this is a really inefficient way to make one, but I honestly don't know how I could have m...
I wanted to solve a problem where I sort an array of any size and return the minimum number of swaps. The explanation for the distance 2 is that I choose 3 neighboring elements ABC and then swap them to CBA. My code partially works as long as the array isn't too big, but pretty inefficient in my opinion. Anyone have a ...
I wrote a Dockerfile to install ecCodes for use in a python environment using cfgrib and xarray. The tarball can be found on the ecCode releases page Dockerfile # syntax=docker/dockerfile:1 # ECCODE COMPILE FROM python:3.10.4 as compiler # /path/to/where/you/install/eccodes ENV ECCODES_DIR=/usr/src/eccodes # the zip fi...
I have the below code that seems to be taking a while to run over time. info_participants = info['participants'] for participant in info_participants: info_gamestatistics_table = flatdict.FlatDict(participant, delimiter='_') info_gamestatistics_table = dict(info_gamestatistics_table) info_gamestatistics_df...
Recently, I needed to sort iterators by their first value and/or use them in BinaryHeap. There are things I don't like about this implementation: Using RefCell. Mutating an underlying object while calling eq/cmp/etc methods. Using unsafe in Deref. It seems to be doing exactly what I want but I feel there must be a be...
The method to overwrite the same line is well known and I use it for countdown, but what about when the next output string has a different size and will be generated by a single print? That's the reason for my question! I use a text countdown timer like (all on the same line): Next activation in 5 seconds Next activat...
Given a boolean expression consisting of the symbols 0 (false), 1 (true), & (AND), | (OR), and ^ (XOR), and a desired boolean result value result, implement a function to count the number of ways of parenthesising the expression such that it evaluates to result. EXAMPLES: countEval("1^0|0|1", false) -> 2; countEval("0&...
I am performing a REST API call and I have copied their example code where they show how to perform such an api call. Their example is written in Javascript not Typescript though. To adapt the code I had to create a type type serviceConfig = {[key: string]: any} so that the variable config can be successively appended ...
I just finished a course of functional programming in uni and continued to study Haskell because I found it very interesting! I made a simple hangman game and would like to hear any of your thoughts and ideas that may arise looking at the code! What, for example, could make it more dogmatic in a functional programming ...
my program requires a hash to be generated for files and folders for data integrity between transfers and file system events (if hash is different, file is not ready). For data integrity, I wish to use SHA-256 and for checking if a file is ready for transfer, I am using a custom hash that uses small parts of the start,...
I have a piece of code to send and receive buffers. Is this the right way to do it? And am I guaranteed that the full buffer will be sent and received? receiving function: #include <stdio.h> #include <winsock2.h> #include <ws2tcpip.h> #include <direct.h> #include <string.h> #include <stdint.h> static inline uint32_t n...
I was faced with a coding challenge and I'm looking for a more elegant way to achieve the goal. The challenge Take the word baseball from the first item in the string array and split it into two comma separated words using only the terms provided in the second item of the string array. If it's impossible to split the ...
Re - designing c-style input output [ btw I use printf() and scanf() in the core ] Reasons for redesigning it :- Needs 2 functions for input output [ namely printf() and scanf() ] Can't customize the format specifiers Can't print float/double point precisely / dynamically [ i.e printing 3.5 makes 3.500000 from printf(...
I write my Python program below for this Leetcode problem: Given a string s, find the length of the longest substring without repeating characters. Example 1: Input: s = "abcabcbb" Output: 3 Explanation: The answer is "abc", with the length of 3. Example 2: Input: s = "bbbbb" Output: 1 Explanation: The answer is "b",...
What's up? this is a small project to teach myself Docker. This Docker setup works, healthchecks pass for both app and mysql, app is initialized and is listening as expected, what I'm looking is a feedback on the docker-compose and the Dockerfile parts. FROM python:3-alpine3.16 ENV FLASK_APP=app ENV FLASK_ENV=developm...
A few more rewrites down the line from my previous question, this is the C version 11 based on the PostScript prototype version 12. The PostScript version is shorter, but it's some crazy ass PostScript gibberish that's like my own private dialect, so translating to C makes it easier to share with the world. I showed of...
Beginning of program assignment has a bug collector input the amount of bugs collected each day of the week then outputs the total number of bugs in a print statement. My professor has forbid us from using 'while true' and 'break'. Assignment requires the loop finishes only when the user inputs 'done' so I wrote an inp...
Given a Dict[str, Any] and a mapping of "key paths" to new names, produce a new dict in the shape of the original that uses the new names while preserving everything else. Example Let's say this is the original dict: d = { "id": 1, "summary": { "origin": { "url": "https://www.google.com/", ...
I have the following code which removes a dict from a list of dicts in Python based on whether the Date key has a value greater than 180 days ago (ideally needs to be 6 months) gp_clinicals_meds_repeat = session["gp_clinicals_meds_repeat"] for i in range(len(gp_clinicals_meds_repeat["GpRepeatMedicationsList"])): da...
I have an array with the days of the week: const testArray = ['Monday', 'Friday', 'Saturday']; I want to populate the values true or false of an object containing days of the week based on whether if the particular day is included in the given array. Right now I'm checking the array for each day like so: { Monday: !...
I have an array of values containing names, e.g. let members = [{id: 1, name: 'Tyler'}, {id: 2, name: 'John'}, {id: 3, name: 'Dayo'}, ..., {id: 7, name: 'George'] There's multiple ways I can generate a string that looks like: Tyler, John, Dayo and 4 Others Here's one way I'm doing this: let memberString = members.len...