Find the first value in javascript assignment expert

Find the First Value

Given an array myArray of positive integers, write a JS program to find the smallest integer divisible by 2 and 3.

input

the input will be a single line containing an myArray

output

the output should be a single line containing a number divisible by 2 and 3 or undefined.

input1

[51,18,15,12]

output1

12

input2

[41,29,17,19,31]

output2

undefined

"use strict";

process.stdin.resume[];

process.stdin.setEncoding["utf-8"];

let inputString = "";

let currentLine = 0;

process.stdin.on["data", [inputStdin] => {

 inputString += inputStdin;

}];

process.stdin.on["end", [_] => {

 inputString = inputString

  .trim[]

  .split["\n"]

  .map[[str] => str.trim[]];

 main[];

}];

function readLine[] {

 return inputString[currentLine++];

}

function main[] {

 let myArray = JSON.parse[readLine[]];

 /* Write your code here and log the output */

}

find the first value

given an array myArray of positive integers, write a JS program to find the first smallest integer divisible 2 and 3 Log the number or Undefined.in case no integer is found divisible by 2 and 3

input1

[51,18,15,12]

output1

[12]

input2

[41,29,17,19,31]

output2

undefined

"use strict";

process.stdin.resume[];

process.stdin.setEncoding["utf-8"];

let inputString = "";

let currentLine = 0;

process.stdin.on["data", [inputStdin] => {

 inputString += inputStdin;

}];

process.stdin.on["end", [_] => {

 inputString = inputString

  .trim[]

  .split["\n"]

  .map[[str] => str.trim[]];

 main[];

}];

function readLine[] {

 return inputString[currentLine++];

}

function main[] {

 let myArray = JSON.parse[readLine[]];

 /* Please do not modify anything above this line */

 /* Write your code here and log the output */

}

Codersarts  is a top rated website for JavaScript Assignment Help, Project Help, Homework Help and Mentorship. Our dedicated team of JavaScript assignment experts will help and guide you throughout your Web Development journey

Javascript Assignment Help

Get help from Javascript expert in JavaScript Assignment Help, Homework Help, Coursework Help and Project Help. Source code will properly commented, following standard coding style, and plagiarism free. If you need help with JavaScript,  our dedicated team of JavaScript experts will guide you throughout your JavaScript learning experiences.

Codersarts is a top rated website for students who is looking for help in programming languages to students at all levels whether it is school, college and university level Coursework Help or Real time JavaScript  project. Submit your assignment requirement and Get your projects done by JavaScript expert developer or learn from JavaScript expert with team training & coaching experiences. Our JavaScript expert will provide help in any type of programming Help, tutoring,  JavaScript project development 

What is JavaScript?

JavaScript is a CS [Client Side] scripting language. It is in no way related to Java as it's name suggests, but it is used for client side scripting. By Client Side scripting, i mean the ability to manipulate data, the DOM and a webpage as a whole, without having a backend service or language. Using JavaScript application development, you can build cross-platform HTML 5+ JavaScript applications and developers can embed functionality created by the third party into their applications, such as Facebook API and Twitter API. JavaScript is also used for a scripting language to develop robust and powerful network applications, mostly server-side ones.

Validations can be done dynamically on the static HTML page by using JavaScript JavaScript validates based on specific patterns like The phone number should consist of 10 numbers with 7,8,9 in 1st position. JavaScript is so easy to get started but overwhelming. Because today, more of us are writing JavaScript than ever before, and if you've been coding for long, you may recognise the value of testing, linting, bundling, transpiling, automated builds, and more, but all too often, we ignore many of these items.  Why? Because setting up a solid JavaScript development environment is so much work. The list of choices is so long and complex that it's hard to know even where to get started. and we are  here to help. A great JavaScript development environment makes doing the right thing the easy thing.  we'll make it happen.

Java and JavaScript are two different programming language which  have different syntax, semantics, and uses. so, Do not confuse JavaScript with the Java programming language. Java is an object oriented and general-purpose programming language. It's platform independent code. compiled one run on multiple platforms, including desktop, mobile and the web. JavaScript [JS] is most well-known scripting language used  for design  Web pages. It is a lightweight, interpreted, or just-in-time compiled programming language with first-class functions.

JavaScript Promises: Who needs the complication of writing code to handle asynchronous activities that happen out of your app's control, such as network requests and file I/O? JavaScript Promises make asynchronous code as easy to write as doThis[].then[that].then[something_else]

Topics we cover in JavaScript Assignment

  • JavaScript Objects in Detail

  • JavaScript Prototype in Plain, Detailed Language

  • JavaScript Variable Scope and Hoisting Explained

  • Understand JavaScript Closures With Ease

  • Understand JavaScript Callback [Higher-Order] Functions

  • Understand JavaScript’s “this” With Clarity, and Master It

  • JavaScript’s Apply, Call, and Bind Methods are Essential

  • Object Oriented JavaScript [OOP in JavaScript] 

  • JavaScript Custom Events with PubSub 

  • Unit Testing Your JavaScript Applications is Essential

  • DOM [Document Object Model] and BOM [Browser Object Model]

  • The Best JavaScript Front-end Frameworks You Should be Using

  • Preventing and Handling JavaScript Errors and Debugging Your Code

Features of JavaScript Assignment Help

  • Rich comment for code

  • Solved  by Industry Pros

  • Self-Paced understandable code

  • Student Support Community

  • Plagiarism Free Code

  • 1-on-1 Session with expert

  • 24 / 7 Query support

  • Concept Explanation 

Get Help From JavaScript Expert For Assignment Help

At Codersarts.com we offer solutions of all aspect of java and assign JavaScript coders to help you with all your JavaScript needs.You can avail by hiring JavaScript developers  and programmers.We provide programming help, coding help, Desktop application, JavaScript application,Web applications, JavaScript framework and other JavaScript Web applications. Get you Project, Assignment done by Javascript expert team at Codersarts.

JavaScript used for?

  • Adding interactive behavior to web pages

  • Creating web and mobile apps

  • Building web servers and developing server applications

  • Game development

​Popular JavaScript Frameworks are:

  • Angular

  • ReactJS

  • Ember.js

  • Vue.js​

Adding interactive behavior to web pages

JavaScript allows users to interact with web pages. There are almost no limits to the things you can do with JavaScript on a web page – these are just a few examples:

  • Show or hide more information with the click of a button

  • Change the color of a button when the mouse hovers over it

  • Slide through a carousel of images on the homepage

  • Zooming in or zooming out on an image

  • Displaying a timer or count-down on a website

  • Playing audio and video in a web page

  • Displaying animations

  • Using a drop-down hamburger menu

Creating web and mobile apps

Developers can use various JavaScript frameworks for developing and building web and mobile apps. JavaScript frameworks are collections of JavaScript code libraries that provide developers with pre-written code to use for routine programming features and tasks—literally a framework to build websites or web applications around.  Popular JavaScript front-end frameworks include React Js, React Native, Angular, and Vue. Many companies use Node.js, a JavaScript runtime environment built on Google Chrome’s JavaScript V8 engine. A few famous examples include Paypal, LinkedIn, Netflix, and Uber!

Building backend applications

Beyond websites and apps, developers can also use JavaScript to build simple web servers and develop the back-end infrastructure using Node.js.

Game development

Of course, you can also use JavaScript to create browser games. These are a great way for beginning developers to practice their JavaScript skills.

Want more coding Help,Assignment Help, JavaScript development services relate to above topics.

How it Works

Send Requirement

Send your JavaScript Assignment / project requirement and tell what you need done in seconds.

Evaluate Project

We'll evaluate your project requirement and assign project to best Expert

Pay safely

Pay using secure payment options using debit / credit card or Bank transfer and by other payment ways

Track Progress

Get Update Everyday and Chat with assigned expert and review their work 24/7.

Why Choose Us?

Plagiarism free

We provide original and fresh code.You can be sure that every assignment we complete contains no plagiarism. Our experts write code  from scratch.

Affordable prices

Best  price offers for Project. Price of the project depends on various factors like deadline, complexity & number of hours work required.

On time Delivery

Our developers will complete your assignment within a tight time frame and always try to complete before the date of submission.

Live Assistance 24*7

You can ask your doubts and question if you need any help. We'll be available online 24 x 7 for support so that get support at the time of your need.

Data Privacy

The contact information you provide here is  100% confidential. We respect your privacy to make sure that your personal data is safe

Standard coding

We follow code standard of programming language and proper comment with doc type format.

Frameworks

We work on modern JavaScripts libraries and frameworks like ReactJs, Angular, Vue.js,  jQuery, Backbone.js, Node. js, Ember. js etc.

Refund

We do offer you a money-back guarantee in case solutions is not as per instruction like mentioned in refund policy.

JavaScripts sample assignments

Assignment Title: Surface Area

Problem Statement

  • Create a variable containing an object that will contain three properties that store the length of  each side of the box.

  • Prompt the user for 3 side lengths and  store them in the properties of the object.

  • Create a function named calcArea that accepts one parameter, the object we created earlier. Using the formula below,calculate and return the surface area.

  • Use template literals to display the three sides of the box and the final surface area with descriptive text.

Sample Output 

Side A=3, side B =4, side C=5

The surface area is:94.

Solution

In this application we create an array of objects  that is A,B and C with assign value zero. In the second step we take three Input using prompt and store value above  objects. In the next step  we create a calcArea function to calculate the area of the surface. Then show the result on the console log.

Assignment Title: Hangman Game

PROBLEM STATEMENT 

  1. Create a secret word that the player will have to guess and store in a JavaScript variable. The words must be in English and use the simple Latin alphabet [All uppercase, no accents].

  2. console.log the secret word so you can peek while debugging. 

  3. Create the clue. Make a string that contains that many underscore characters [_] for every letter in the secret word. Display it on the page in the clue section. Don't hard code this! It must compute a new one if you change your secret word.

  4. When the player clicks on a letter, determine if the letter is in the secret message and show all of the locations of that letter in the clue.

  5. If the letter is not in the message, a body part is added to the hangman. [Change the image. Note that the images are numbered.] The player has six wrong guesses before they lose.

  6. Dim each letter as it is guessed. [There is a CSS class for that called used.]

  7. Do not do anything if the player selects the same letter again and doesn't count it against them.

  8. If the player wins, show the "You Win!" image. If the player loses, show the "You Lose!" image and display the secret word in the clue section.

  9. When the game is over remove the event handler so they can't play anymore and show the message at the bottom to tell the player that the game is over.

Solution:

This app tracks and updates the number of guesses remaining, correct and incorrect letters already guessed, and the users score for the amount of correctly guessed words. Key events listen for the letters that the user types. After the user wins/loses, another word is automatically chosen. This also resets the number of guesses remaining, letters guessed and a new game begins. In this Application we have to write  javascript code, first we create a let type variable word that holds 'HANGMAN' word, and then one other variable x that holds zero. After that we create a clue array and  then execute for loop length of word and assign '_' to the clue array. after that add an event listener  then perform if condition. and add a class used after that to perform a for loop , in this loop assign letter one by one to the clue array and set flag false. After that one if in this condition one switch loop  for display hangman images.then check win or lose. after  the condition, create isHnagmanFulld function. It has a parameter that is a clue array.

Assignment Title: Tic-Tac-Toe game using JavaScript

PROBLEM STATEMENT 

  1. Create two variables called playerX and playerO. Set them to the DOM element with the id "x" and "o" respectively. This is the text at the top that says who's turn it is.

  2. Create a named function with a meaningful name of your choosing. [This will be referred to as the "event handler" in further instructions.] In this   function add a console.log[] statement to display a message in the console.

  3. Create a variable that contains all of the TD elements. Use a for loop or the .forEach[] method to add the function as a click event handler to each of the TD elements. Be sure to use.addEventListener[] rather than older methods of adding event handlers.  Open the console and click a square. You should see the message from your console.log.

  4. In your event handler, add a statement to get the id value of the element with the class "current player" and store it to a variable. Display this value using the same console.log[] you already have. Try clicking a square to see the value.

  5.  At the end of your event handler, add a statement to switch the "current-player" class from the playerX to playerO elements or visa-versa. [Remember you can toggle classes.] Try clicking a few squares, you  should see the player at the top of the page change as well as the output in the console.

  6. In your event handler, add a statement to add the class "x" or "o" to the target element depending on who's turn it is. [the target element is the one that was clicked on. Hint: the event object has a target property.] You should see "X" or "O" appear in the square when you click on it. [The letter is displayed using CSS, refer to that file if you want to see how it is done.]

  7. Add an event handler to the "New Game" button to clear all the squares.

  8. Notice that if you click on a square that is taken by the other player, the marker may turn into a question mark. This is because you have added both "x" and "o" classes to the document. If you used className instead of classList you would be able to take over another player's square. Also, if you click on your own square you waste your turn. Modify the eventhandler to check to see if there is a class on the element already.[Hint: this is a good use of className but there are other ways to do it.] Don't put a marker or count the turn if the square is already taken.

  9. Notice that there is a file called winner.js already referenced from the HTML file. This contains a function called checkWin[]. Since it is included before the main.js file, you can call this function from your code. You can examine this function so that you understand how it works. Call the checkWin[] function from the event handler. The first argument is a string identifying the player, "x" or "o". The second argument is the list of td elements you selected previously.

  10. If there is a winner the checkWin[] function will return an array of  the winning elements, set the background colour to yellow of the three winning squares to highlight them and open an alert box to say who the winner is. Depending on which browser you use, you may not see the last markeror the highlight color until you close the alert box. This is fine. There is a trick to fix this but don't worry about it.

  11. In the event handler for the "New Game" button, add code to  remove the background colour.Play Tic Tac Toe!

Solution

In our program or design [Tic Tac Toe Game], at first, on the webpage, there is a selection box with the game title and two buttons which are labeled as “Player[X]” and “Player[O]”. Users must select one option or button to continue the game. If the user selects the X then the bot will be O and if the user selects the O then the bot will be X. Once the user selects one of them, the selection box will disappear and the playboard is visible. In the above  image we show the X player is  winer and below the image show the Player O is winer. At the center of the webpage, there is a tic tac toe play area with nine square boxes. Once you click on the particular box then there is visible a sign or icon which you have chosen on the selection box. Once you click on any box then after a couple of seconds the bot will automatically select the box which was not selected by you or the bot before, and the opposite icon is visible there means if your icon is X then the bot will have O.Once a match is won by someone, the playboard section will stop and the result box appears with the winner's sign  and change background color.

Assignment Title: An Online Car Rental System

PROBLEM STATEMENT 

  • The website should be dynamic which means all the data is loaded dynamically from theJSON file. If the contents in the JSON file change [e.gThe mileage changes to 12354 forid=1], the pages should change as well.

  • The vehicles available for renting can be divided into three categories: Sedan, Wagon andSUV.

Car image samples are provided on the CANVAS

You need to create a folder “images' 'that stores the pictures for the cars. Each image is named according to the model of the car and the image types are all “jpg”.

Assignment Specification

This assignment requires that you do the following steps:

  • Design a JSON file “cars.json” with the structure specified in requirement 3 and store at least 10 + car data items in the JSON file. Set up the availability state to “True” for 70%of cars in the Warehouse, and a “False” state to the other 30%

  • Use AJAX to load the JSON file “cars.json” and extract the data and save it as arrays in your webpage.

  • Display the cars in a nice tabular format using the above arrays on your webpage for users to select.

  • Provide a “button” to add the car to the reservation “shopping cart”. Use AJAX to check the availability of the car after clicking the button [the field “availability” is included in cars.json]. If the availability is “True” then add the car to the reservation shopping cart and prompt success; If the availability is “False” then alert that “Sorry, the car is not available now. Please try other cars' '.

  • Provide a button/link to view the reservation shopping cart. Display the cars which have been added into the reservation shopping cart [hint: use session to store the data]. Users can set the “rent days' ' or delete cars in the shopping cart.

  • Provide the checkout button to check if there are cars in the shopping cart. If no, then alert“No car has been reserved.” and jump to the first page. If yes, validate the “rental days” [integer, >0] using JavaScript and navigate to the next page.

  • Design the checkout page which displays a purchase form asking the user to fill in their delivery details [name, email address, mailing address, city, state, post-code and payment type]. All these fields must be completed for the order to go ahead. Validate the format of the email address. If all details are filled correctly, then direct the user to a page showing the delivery details and the cost.

Solution

This project is designed so as to be used by Car Rental Company specializing in renting cars to customers. It is an online system through which customers can view available cars, register, view profiles, and book cars. A car rental is a vehicle that can be used temporarily for a period of time with a fee. Renting a car assists people to get around even when they do not have access to their own personal vehicle or don't own a vehicle at all. The individual who wants to rent a car must first contact the car rental company for the desired vehicle. This can be done online. At this point, this person has to supply some information such as; dates of rental, and type of car.

Aims & Objectives

  • To produce a web-based system that allows customers to register and reserve cars online and for the company to effectively manage their car rental business.

  • To ease customer’s tasks whenever they need to rent a car.

Benefits of Online Car Rental Services 

  • This online car rental solution is fully functional and flexible.

  • It is very easy to use.

  • This online car rental system helps in back office administration by streamlining and standardizing the procedures.

  • It saves a lot of time, money, and labor.

  • The software acts as an office that is open 24/7.

Assignment Title: Online Examination

Requirement

The problem with the current system is that students take their exam manually. This outdated system will take long time utilization; the manual procedure used for conducting exams is a time consuming process. More time is being used for lecturers to bring the questions papers and answer sheets and also more time is needed for students in order to write their exam. Students are not satisfied with the current system of taking the multiple choice examination. The no accuracy with current system when students did not use a 2b pencil student are losing their mark. Using the manual procedure of conducting examinations we are not saving the environment by using more paper, we are in a world where we really need to take care of the environment.

Solution

This project is aimed at developing an online examination system for introduction to management for students and lecturers. The purpose of the system is to completely automate the old manual procedure of conducting exams to a computerized System. I will provide a more efficient examination system. The system will allow students to register and take the exam. This project has many categories of tests like HTML,CSS,JAVASCRIPT etc. Students can choose a category of test and click on submit button then student take test. After submitting the test, the scorecard will become a scorecard on the screen. After the display score card, students can logOut. 

Assignment Title: Online Examination

Requirement

The problem with the current system is that students take their exam manually. This outdated system will take long time utilization; the manual procedure used for conducting exams is a time consuming process. More time is being used for lecturers to bring the questions papers and answer sheets and also more time is needed for students in order to write their exam. Students are not satisfied with the current system of taking the multiple choice examination. The no accuracy with current system when students did not use a 2b pencil student are losing their mark. Using the manual procedure of conducting examinations we are not saving the environment by using more paper, we are in a world where we really need to take care of the environment.

Solution

This project is aimed at developing an online examination system for introduction to management for students and lecturers. The purpose of the system is to completely automate the old manual procedure of conducting exams to a computerized System. I will provide a more efficient examination system. The system will allow students to register and take the exam. This project has many categories of tests like HTML,CSS,JAVASCRIPT etc. Students can choose a category of test and click on submit button then student take test. After submitting the test, the scorecard will become a scorecard on the screen. After the display score card, students can logOut. 

From the JavaScript Assignment Help Blog


What’s new and exciting at Codersarts – JavaScript Assignment Help, Hire JavaScript Developer, JavaScript experts, blogs and more.

Javascript Assignment Help

Looking for an expert to provide you help in  javascript assignment help?  or javaScript Homework Help with  net and clean coding with  sufficient comments

Javascript project Help

If you're looking for mini-projects, final year college project, research project, website from basic to  complex, REST API, Barcode reader code, graph/chart

javascript programming Help

Learn to code, debug, ,Fixing your written code, programming help like algorithms, flowcharts,

programming construct loop, writing secure code

Javascript Expert/ tutors service

Stuck on a coding exercise?

Need coding help with algorithms or a programming course? Hire top programming tutors to answer your questions

Chủ Đề