1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
zheka24 [161]
3 years ago
6

Function _one(array)

Computers and Technology
1 answer:
dsp733 years ago
6 0

Answer:

function removeRepeaters(list){

   var goodList = [], badList = {}, used = {}, n;

   // ensure that the argument is indeed an array

   if(!Array.isArray(list)){

        throw "removeRepeaters: Expecting one argument of type Array";

   }

   // loop through the array and take note of any duplicates

   for(n in list) used[list[n]] == true ? badList[list[n]] = true : used[list[n]] = true;

   // now loop through again, and assemble a list of non-duplicates

   for(n in list) if(badList[list[n]] == undefined) goodList[] = list[n];

   return goodList;

}

Explanation:

I assume you're familiar with trinary operators, but just in case, that's what's happening in this first for loop:

for(n in list) used[list[n]] == true ? badList[list[n]] = true : used[list[n]] = true;

this is the same as saying:

for(n in list){

   if(used[list[n]] == true){

       badList[list[n]] = true;

   } else {

       used[list[n]] = true;

   }

}

This loop flags all of the values in the list that are duplicated.  Note that both "badList" and "used" are declared as objects instead of arrays.  This allows us to compare keys in them with an == operator, even if they're not defined, making it a convenient way to flag things.

Note that I haven't tested it, so I may have overlooked something.  I suggest testing it before handing it in.

You might be interested in
Which of these is a Microsoft certification CCIE PMP PRINCE2 MCSE
Angelina_Jolie [31]

MCSE is a Microsoft Certified Solutions Expert.

6 0
3 years ago
Identify measures to protect your computer against threats from human actions. You cannot access a file in a computer that belon
scZoUnD [109]

Answer:

Firewalls

Explanation:

A firewall is simply a network security system whose main duty is. to prevent unwanted access to. private network.

Firewalls is measures to protect your computer against threats from human actions.

It is also the one singular thing that prevents you from accessing the file on your friends system.

5 0
3 years ago
Since the 1960s, there have been five major generations, or cycles, of computing. Which represents those generations in order?
sergiy2304 [10]

Answer:a) Mainframes, miniframes, PCs, desktop Internet computing, mobile computing

Explanation: The hierarchy of the computers or computing are in the generation is:-

  • Mainframe:-designed for the execution of huge data processing , storage and execution.
  • Miniframe:-has similar functioning as the mainframe but on smaller scale and version.
  • Personal computer(PC):-It is designed for the individual purpose and according the need of the user.
  • Mobile computing:-computing that can be done on the mobile phone similar to the computing on the personal computer
  • Internet computing:-the computing of the mobile and computer system with the facility of the internet connectivity.

7 0
3 years ago
Keep a log of the different types of communication activities in which you engage during the rest of the day. Categorize each ac
baherus [9]

There are 4 different types of communication and I can share my experience by helping you out to solve the assignment.

Explanation:

1. Verbal Communication:

  • Communication with voice
  • Provides active listening
  • Body language is equally important.

2. Non-Verbal:

  • Body language is the most important
  • Communicating without using the words

3. Visual communication:

  • Listening contents through photos and videos

4. Written communication:

  • Serves as record
  • Does not require tone

So in day today aspect we come across almost all type of communication. To answer the discussed question

1. Did the variety of communication surprised you?

I would say yes. I can say unknowingly I have experienced various types.

2. Did you find that your were more involved in one type of communication?

I would say yes. People may like communication type depending on their interest and skill set. So according to me even I have involved in my life with one set of communication and I am trying to use it more.

3. Which one(s) is/are most involved?

So it differs from people to people. I like verbal communication, because I am good at speaking with good tone and voice. Also, I am attracted towards visual communication because one picture will talk more than what an essay would communicate.

6 0
3 years ago
What are some types of vehicle technology advancements?
julia-pushkina [17]

Answer:

D is the suitable answer.

Explanation:

All of the above

5 0
3 years ago
Other questions:
  • Which of the following are types of formatting you
    12·2 answers
  • Which option organizes tasks based on importance?
    12·1 answer
  • What are 2 ways that technology can negatively impact the environment.
    8·2 answers
  • Which Supreme Court case resulted in a decree issued for the Michigan Department of Corrections to provide female inmates access
    10·1 answer
  • The computer has had far-reaching effects on our lives.how has the computer effected your life?
    8·1 answer
  • Given two variables, is Empty of type boolean, indicating whether a class roster is empty or not, and number Of Credits of type
    10·1 answer
  • Shelby wants to move “ExpirationDate” to the top of the datasheet. What should she do?
    13·1 answer
  • Why must web designers select a common font?​
    8·2 answers
  • Zoe wants to post something controversial online, but then she remembers that employers may look at her social media when she st
    10·1 answer
  • Why are my texts green when texting another iphone.
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!