Skip to content

Instantly share code, notes, and snippets.

krissanawat101 krissnawat

Block or report user

Report or block krissnawat

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View BinarySearch.js
let BinarySearch = function (list, item) {
let  startIndex = 0,
let endIndex = (list.length)-1;
while (startIndex <= endIndex ){
// Find the mid-value
View chat.js
import React, {Component} from 'react';
import {TextInput, StyleSheet, Text, View} from 'react-native';
import io from 'socket.io-client';
export default class App extends Component {
constructor(props) {
super(props);
this.state = {
chatMessage: '',
chatMessages: [],
View strArray.js
const strArray = ['JavaScript', 'Python', 'PHP', 'Java', 'C'];
function mapForEach(arr, fn) { const newArray = [];
for(let i = 0; i<arr.length; i++) {
newArray.push(
fn(arr[i])
);
} return newArray;
}
const lenArray = mapForEach(strArray, function(item) {
return item.length;
View persons.js
const persons = [
{ name: 'Peter', age: 16 },
{ name: 'Mark', age: 18 },
{ name: 'John', age: 27 },
{ name: 'Jane', age: 14 },
{ name: 'Tony', age: 24},
];
const fullAge = [];for(let i = 0; i<persons.length; i++) {
if(persons[i].age >= 18) {
fullAge.push(persons[i]);
View airbnbclone.sh
target 'airbnbclone' do
# Pods for airbnbclone
pod 'Firebase/Auth'
View link firebase.sh
View npm.sh
npm install react-native-firebase
You can’t perform that action at this time.