This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 1 Write a JavaScript function to check whether an `input` is an array or not. | |
| 2 Write a JavaScript function to clone an array. | |
| 3. Write a JavaScript function to get the first element of an array. Passing a parameter 'n' will return the first 'n' elements of the array. | |
| Test Data : | |
| console.log(first([7, 9, 0, -2])); | |
| console.log(first([],3)); | |
| console.log(first([7, 9, 0, -2],3)); | |
| console.log(first([7, 9, 0, -2],6)); | |
| console.log(first([7, 9, 0, -2],-3)); | |
| Expected Output : |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 1 Write a JavaScript program to create a new string adding "Py" in front of a given string. If the given string begins with "Py" then return the original string. | |
| 2 Write a JavaScript program to create a new string from a given string changing the position of first and last characters. The string length must be greater than or equal to 1 | |
| 3 Write a JavaScript program to check if the last digit of the three given positive integers is the same. | |
| 4 Write a JavaScript program to reverse a given string. | |
| 5 Write a JavaScript program to rotate the elements left of a given array of integers of length 3. | |
| 6 Write a JavaScript program to find the larger value between the first or last and set all the other elements with that value. | |
| 7 Write a JavaScript program to find the number which appears most in a given array of integers. | |
| 8 Write a JavaScript program to find the number of times to replace a given number with the sum of its digits until it converts to a single digit number. | |
| 9 Write a JavaScript program to check whether |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const student = { | |
| firstname: 'Shailesh', | |
| lastname: 'Prajapati', | |
| country: 'India' | |
| }; | |
| // Object Destructuring | |
| const { firstname, lastname, country } = student; | |
| console.log(firstname, lastname, country); // Glad Chinda Nigeria |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const animals = [ | |
| { | |
| "name": "cat", | |
| "size": "small", | |
| "weight": 5 | |
| }, | |
| { | |
| "name": "dog", | |
| "size": "small", | |
| "weight": 10 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React,{Component} from 'react'; | |
| import { | |
| Animated, | |
| Easing | |
| } from 'react-native'; | |
| export default class Pulse extends Component { | |
| constructor(props) { | |
| super(props); | |
| this.pulseValue = new Animated.Value(0) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Todo.all.each do |todo| | |
| unless todo.name.nil? | |
| todo.update(name: todo.name.strip) | |
| else | |
| todo.destroy | |
| end | |
| end | |
| AgencyUser.all.each do |agency| | |
| category = Category.create(name: 'Caregiver Personal Care', agency_user_id: agency.id) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React,{Component} from 'react'; | |
| import { | |
| View, | |
| Button | |
| } from 'react-native'; | |
| import ToastModule from 'react-native-android-toast'; | |
| export default class ToastDemo extends Component { | |
| showToast = () =>{ | |
| ToastModule.show("Hello World"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "dependencies": { | |
| "babel-plugin-transform-remove-console": "^6.8.5", | |
| "moment-timezone": "^0.5.13", | |
| "native-base": "2.3.3", | |
| "react": "16.0.0-alpha.12", | |
| "react-native": "0.48.0", | |
| "react-native-android-toast": "file:../" | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import {NativeModules} from 'react-native'; | |
| module.exports = NativeModules.ToastModule; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.toast; | |
| import com.facebook.react.ReactPackage; | |
| import com.facebook.react.bridge.JavaScriptModule; | |
| import com.facebook.react.bridge.NativeModule; | |
| import com.facebook.react.bridge.ReactApplicationContext; | |
| import com.facebook.react.uimanager.ViewManager; | |
| import java.util.ArrayList; | |
| import java.util.Collections; |